Creating a one click demo importer

I believe that if you are not going to do a massive sql insert (which I think is likely just as efficient) that you need to go ahead and utilize the plugin api and at the time of the button being pressed, create them. I think it’s pretty clear your choice is either to create … Read more

Theme Customizer – Choose where widget area appears, to let users organise widgets

You can move around sections in the customizer simply by accessing the datastructure and assign a different value to the panel. So supposing that your widget area, created in the usual way, is called wpse210938_area and you want to move it to the panel wpse210938_panel, you do this: add_action( ‘customize_register’, ‘wpse210938_move_widget_area’ ); function wpse210938_move_widget_area () … Read more

add_page_menu to make shortcut to widgets

You can add a link to the widgets.php like that: add_action( ‘admin_menu’, ‘f711_add_widgets_shortcut’, 999 ); function f711_add_widgets_shortcut() { add_menu_page( ‘Widgets’, ‘Widgets’, ‘publish_pages’, ‘widgets.php’, ”, ”, 61 ); } Be sure to check your permission settings, and you may also include another image. You can find the documentation about the function at The Codex.

dynamic_sidebar() returns false in admin section

Yes, you have to make sure to hook this function at some point after the sidebars are registered. It’s not quite explained, but implied in the codex that this function dynamic_sidebar( $index ) expects them to be registered and loaded as registered by the time it runs. Otherwise, it won’t have anything to match the … Read more

Class ‘WP_Widget’ not found

You should never work on core files which are inside wp-admin and wp-includes folder. You’ll be just working on wp-content folder. If you’re developing a plugin, you can directly put the code in your main plugin file or you can put the file inside of your plugin folder and include that file in the plugins … Read more

How to add a class to a link in text editor

You can use third party free WordPress plugin “Extend Link“. You can activate this plugin and add extend link as shown in below screenshot. Now when you click on “Extend Link”, you will see the popup similar to default link popup but with an additional option to add IDs, Class and Rel. https://wordpress.org/plugins/extend-link/ Please let … Read more

WordPress tag cloud add more links

Yes, you can. WP_Widget_Tag_Cloud widget uses wp_tag_cloud to generate the tag cloud. And inside that function and at the end of that function you can find this: /** * Filters the tag cloud output. * * @since 2.3.0 * * @param string $return HTML output of the tag cloud. * @param array $args An array … Read more