Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Notice: Only variables should be passed by reference
Forum PHP.pl > Forum > Przedszkole
drdro
Cześć,

szablon WP mi wypluwa ten błąd i zaznacza linię 330 a ja nic tam nie widzę i nie umiem wyklikać żeby pojawiać się przestał.
Załączam fragment kodu z zaznaczoną linią.


Kod
/**
       * Check if in theme mode.
       *
       * If OT_THEME_MODE and OT_CHILD_THEME_MODE is false, set the
       * directory path & URL like any other plugin. Otherwise, use
       * the parent or child themes root directory.
       *
       * @since     2.0
       */
      if ( false == OT_THEME_MODE && false == OT_CHILD_THEME_MODE ) {
>>>        define( 'OT_DIR', plugin_dir_path( __FILE__ ) );
        define( 'OT_URL', plugin_dir_url( __FILE__ ) );
      } else {
      
if ( true == OT_CHILD_THEME_MODE ) {
          $path = ltrim( end( @explode( get_stylesheet(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
          define( 'OT_DIR', trailingslashit( trailingslashit( get_stylesheet_directory() ) . $path ) );
          define( 'OT_URL', trailingslashit( trailingslashit( get_stylesheet_directory_uri() ) . $path ) );
        } else {
          $path = ltrim( end( @explode( get_template(), str_replace( '\\', '/', dirname( __FILE__ ) ) ) ), '/' );
          define( 'OT_DIR', trailingslashit( trailingslashit( get_template_directory() ) . $path ) );
          define( 'OT_URL', trailingslashit( trailingslashit( get_template_directory_uri() ) . $path ) );
        }
      }


Z góry dzięki za pomoc.
Puszy
W teorii poniższy kod powinien zadziałać i jednocześnie zwrócić błąd w kolejnych

  1. $var = plugin_dir_path( __FILE__ );
  2.  
  3. define( 'OT_DIR', $var);
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.