Declaring script dependencies between scripts enqueued with different action hooks

The simple answer is, “No”. Although admin_enqueue_scripts and wp_enqueue_scripts hooks does exactly the same thing, the do their work in separate places which do not have any reference to the other. wp_enqueue_scripts runs on the public side or front end admin_enqueue_scripts As the name suggests, it runs on the admin side or back end Your … Read more

Modify the_content after the more tag

I think you can use the get_extended( $post ) function; that returns an array with different parts of the content. See this example which works inside the Loop: $content_arr = get_extended( get_the_content() ); var_dump( $content_arr ); echo $content_arr[‘main’]; //Display the part before the more tag

how to not show plugin in admin area

To complement @s_ha_dum’s answer: If you just want to offer a function to be used in a theme, make it a custom action. Sample: add_action( ‘call_hello_world’, ‘hello_world’ ); Now, in a theme, the author can call your function with … do_action( ‘call_hello_world’ ); … and the function will print its content only where the author … Read more

Plugin.php: PHP Notice: Undefined offset: 0 in

Some code on your site registers a filter or an action with invalid arguments. The errors you see happen, because add_action() or add_filter() was called with a second argument that is not a string, an object or an array. Examples: add_action( ‘wp_head’, NULL ); add_filter( ‘the_content’, -1 ); Disable all plugins, switch to Twenty Eleven, … Read more

How can I let users to access plugin functions based on roles?

You can check if current user is an Author (WP-Codex) $current_user_is_allowed_to_edit = false; if ( current_user_can(‘delete_posts’) ) { $current_user_is_allowed_to_edit = true; } And use it in the if-statement at the point where you implement the Live Edit function. Here is the whole code (for user roles): http://pastebin.com/fY7UPcB1 EDIT: Here is the new code (check for … Read more

Make the plugin directory recognize new version numbers

You need to make sure you update version numbers in all relevant locations: \trunk readme.txt pluginfile.php \tags\{tag} pluginfile.php (note: you should update readme.txt, but outside of trunk, it’s only for aesthetics) In this case, you updated readme.txt in \trunk, but you didn’t update the Plugin file in \trunk or in \tags\0.3.1.