Custom plugin development get help context to work in WP 4.3

The problem here is this: add_action(‘load-‘ .CUSTOM_POST_TYPE, ‘my_plugin_add_help’); While your hunch that you need to put array( $this, ‘my_plugin_add_help’ ) because it’s inside a class is correct, the root of the problem is that the hook you’re trying to attach it to is never called, and isn’t a part of standard WordPress. Instead, try hooking … Read more

Proper context for wp_remote_post()

You shouldn’t post directly to your plugin file – WordPress won’t be loaded, and you shouldn’t load it manually. Use the AJAX API and an action hook to handle it (note it doesn’t need to be an actual AJAX request): function wpse_180814_post_to_plugin( $name, $email ) { $result = wp_remote_post( admin_url( ‘admin-ajax.php’ ), array( ‘body’ => … Read more

Issue with contextual help overwriting existing content

In order to not delete help from all other screens, you need to always return the contextual help text, otherwise your filter doesn’t return anything for non-page/post screens and so nothing will show up. Move the return to the bottom of the function, outside of your if/else. Also, the original contextual help is being concatenated … Read more

Instructions/Rules Inside Text Area

Add some custom javascript to the admin area, using wp_enqueue_script(). $(document).ready(function() { $(‘#input-id’).attr(‘placeholder’, ‘Did you try Google first?’); }); The placeholder attribute does not work in Internet Explorer yet. You could fall back on a jQuery placeholder plugin if needed.

contextual_help, change the “Help” tab label

Look at the source, there is no filter to alter the ‘Help’. But it does translate the text so you can hook onto the gettext filter. Not the nicest of solutions (an alternative would be to use javascript) : add_filter( ‘gettext’, ‘wpse51861_change_help_text’, 10, 2 ); function wpse51861_change_help_text( $translation, $text ) { if ( $text == … Read more

Where can I edit Admin Panel Page file

You can add the custom help by adding a hook to the page load e.g. page-new.php would become load-page-new.php function custom_help_page() { add_filter(‘contextual_help’,’custom_page_help’); } function custom_page_help($help) { $custom = “<h5>Custom Help</h5> <p>Custom help content</p>”; return $custom.$help; } add_action(‘load-page-new.php’,’custom_help_page’); //New page add_action(‘load-page.php’,’custom_help_page’); //Page, edits, updates etc. If you don’t want the default help to still display, … Read more