Allowing Custom Capability to Manage Plugin Options

If you use the Settings API, that $option_page is the value of a hidden <input> field generated by settings_fields(). For example: <input type=”hidden” name=”option_page” value=”{Option group name}”> So if you have settings_fields( ‘my-group’ ) in your code, then the $option_page would be my-group. See the (as of writing, 5th) note here. Code sample: (tried and … Read more

Gutenberg: How to use output of php render_callback function in the block editors backend?

I think that you are missing the PHP registration of the block. The JS definition is all right, but you need to tell PHP that the block exists. Can you try to register your block in your plugin or function.php file? Here is an example https://developer.wordpress.org/block-editor/tutorials/block-tutorial/creating-dynamic-blocks/ <?php function simpletoc_toc_render_callback( $attributes, $content ) { return ‘This … Read more

What are good plugins for beginners? [closed]

These are all plugins that I’ve used, and while I’m sure there’s a lot of good plugins I’ve missed, but these are ones I’ve had experience with and would recommend as enhancing your WordPress blog. Akismet – this is included with WordPress and is (in my opinion) one of the essential plugins you will need … Read more

Tag selector like stackexchange?

you can do that using JQuery autocomplete plugin and once you have included all of the needed JS files just add this code after your new post form $terms = get_terms(“post_tag”); $tags=””; $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { $tags .= ‘”‘.$term->name.'”, ‘; } $tags = … Read more

How can I attach images to a post from the media library?

This is not something that is currently supported in WordPress. There’s some discussion about it here: http://core.trac.wordpress.org/ticket/6820 One plugin which does enable this functionality is: http://skyphe.org/code/wordpress/file-gallery/ This plugin does a few extra things, but one option it provides is that after clicking “upload/insert” and going to the media library tab, you can tick check boxes … Read more