• bearshang

    (@bearshang)


    
    add_action( 'admin_enqueue_scripts', 'adminAssets' );
    function($hook_suffix){
       echo $hook_suffix;
    }
    

    However, the result of $hook_suffix is: ‘%e7%94%a8%e6%88%b7_page_users-user-role-editor’.

    I don’t know what is ‘%e7%94%a8%e6%88%b7’, how to troubleshoot this string?

Viewing 7 replies - 1 through 7 (of 7 total)
  • subrat4php

    (@subrat4php)

    Hi! @bearshang,

    It seems your code is not complete. Please check once.

    add_action( 'admin_enqueue_scripts', 'adminAssets' );
    function adminAssets($hook_suffix){
       echo $hook_suffix;
    }
    Thread Starter bearshang

    (@bearshang)

    yes, as you perfect code.

    I wrote less of an adminAssets.

    subrat4php

    (@subrat4php)

    @bearshang,

    Is it working now??? If not, can you please explain bit more of the problem you are facing so that I can suggest you something from my end.

    ??

    Thread Starter bearshang

    (@bearshang)

    It not normal working,
    If nothing goes wrong then he should output: ‘users_page_users-user-role-editor’, That is, I guess the reason may be due to coding.

    What’s bad is, This problem is in the plug-in I wrote, And he affected all the other plugins.

    But I really don’t know what the problem is with the plug-in I wrote.

    subrat4php

    (@subrat4php)

    @bearshang,

    what is the purpose of the block of code you were writing and what this ‘users_page_users-user-role-editor’ will output???

    Thread Starter bearshang

    (@bearshang)

    You may not understand what I mean. In fact, I used a wordpress plugin user-role-editor.

    In /wp-content/plugins/user-role-editor/includes/classes/user-role-editor.php 924 row:

    
    /**
         * Load plugin javascript stuff
         * 
         * @param string $hook_suffix
         */
        public function admin_load_js($hook_suffix) {
    
            URE_Known_JS_CSS_Compatibility_Issues::fix($hook_suffix, $this->ure_hook_suffixes);                
            
            if ($hook_suffix==$this->main_page_hook_suffix) {
                $this->load_main_page_js();
            } elseif($hook_suffix==$this->settings_hook_suffix) {
                $this->load_settings_js();
            }                
    
        }
        // end of admin_load_js()
    

    Among them, he needs to get the value of $hook_suffix and make a judgment. Under normal circumstances, the value of his $hook_suffix should be ‘users_page_users-user-role-editor’, but now it is ‘%e7%94%a8%e6%88%b7_page_users-user-role-editor’, so it doesn’t work.

    After my one-by-one pause on each plugin, I found the problem in the plugin I wrote.

    This is my current predicament. Do you not understand that you can understand?

    subrat4php

    (@subrat4php)

    @bearshang,

    First thing is I am in no where why you have to edit the plugin wp role editor?
    Second thing is, if you need some customization work then you must do it by hooks and filters available with wordpress.
    Third thing is, i am really not sure what is your actual requirement and what you were trying to do?

    I am sorry but its what i felt.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘admin_enqueue_scripts $hook_suffix can’t work normally.’ is closed to new replies.