Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Notice: Only variables should be passed by reference
drdro
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 7.02.2017

Ostrzeżenie: (0%)
-----


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.

Ten post edytował drdro 7.02.2017, 13:36:21
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
Puszy
post
Post #2





Grupa: Zarejestrowani
Postów: 279
Pomógł: 42
Dołączył: 10.10.2011

Ostrzeżenie: (0%)
-----


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);


Ten post edytował Puszy 7.02.2017, 15:12:28
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 10:23