• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Easy Digital Downloads a2z

Easy Digital Downloads a2z

Easy Digital Downloads a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / EDD_Session::should_start_session() – Determines if we should start sessions

You appear to be a bot. Output may be restricted

Description

Determines if we should start sessions

Usage

$bool = EDD_Session::should_start_session();

Parameters

Returns

bool

Source

File name: easy-digital-downloads/includes/class-edd-session.php
Lines:

1 to 33 of 33
  public function should_start_session() {

    $start_session = true;

    if( ! empty( $_SERVER[ 'REQUEST_URI' ] ) ) {

      $blacklist = $this->get_blacklist();
      $uri       = ltrim( $_SERVER[ 'REQUEST_URI' ], '/' );
      $uri       = untrailingslashit( $uri );

      if( in_array( $uri, $blacklist ) ) {
        $start_session = false;
      }

      if( false !== strpos( $uri, 'feed=' ) ) {
        $start_session = false;
      }

      if( is_admin() && false === strpos( $uri, 'wp-admin/admin-ajax.php' ) ) {
        // We do not want to start sessions in the admin unless we're processing an ajax request
        $start_session = false;
      }

      if( false !== strpos( $uri, 'wp_scrape_key' ) ) {
        // Starting sessions while saving the file editor can break the save process, so don't start
        $start_session = false;
      }

    }

    return apply_filters( 'edd_start_session', $start_session );

  }
 

 View on GitHub View on Trac

Published: 26th November 2019 | Last updated: 12th September 2021

Primary Sidebar

Information

Function name: EDD_Session::should_start_session
Class ref: EDD_Session
Plugin ref: Easy Digital Downloads
Version: 2.11.6
Sourcefile: includes/class-edd-session.php
File ref: includes/class-edd-session.php
Deprecated?: No
API Letters: E,S

Footer

Easy Digital Downloads a2z
Easy Digital Downloads a2z
Easy Digital Downloads a2z
WordPress 5.9.3
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  edd.wp-a2z.org
© Copyright Easy Digital Downloads a2z 2014-2022. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites