Gutenberg Block Style CSS Class Is Not Applying on Backend

Turns out, you need to manually add the wrapper class in the edit function. Here’s the source – https://developer.wordpress.org/block-editor/developers/block-api/block-edit-save/#classname I changed this line – <section className={`text-section-one`} style={{ backgroundColor: `${bgColor}`}} > to <section className= { `${props.className} text-section-one`} style={{ backgroundColor: `${bgColor}`}} > and it solved problem.

Why is my custom post type not being activated on plug-in activation?

That’s not how register_activation_hook works. register_activation_hook is called only once, when the plugin is activated. CPT’s however need to be registered on every single request, not just when the plugin is activated. This is because WP doesn’t store a list of CPT’s in the database, it’s generated at runtime by PHP code. So instead, register … Read more

WordPress error: Options page Setting_ not found in the allowed options list

Fixed! function Setting_() { register_setting( ‘Set_my_options’, ‘My_plugin_header_logo’ ); register_setting( ‘Set_my_options’, ‘My_plugin_links_facebook’ ); register_setting( ‘Set_my_options’, ‘My_plugin_links_youtube’ ); register_setting( ‘Set_my_options’, ‘My_plugin_links_email’ ); register_setting( ‘Set_my_options’, ‘My_plugin_links_instagram’ ); } add_action( ‘admin_init’, ‘Setting_’ ); settings_fields( ‘Set_my_options’ );

When echoing my own shortcode, it keeps adding a 1 at the end of my blogpost

This is your problem: public function listLayout() { return require( $this->plugin_path . “/admin/itemList.php” ); } Shortcodes need to return their output as a string, but this does not. The shortcode is outputting directly, rather than being output at the correct time by WordPress. This would become very apparent if nested shortcodes were used as the … Read more