jquery not calling php function

For logged in users, use: wp_ajax_{$action} For logged out users, use: wp_ajax_nopriv_{$action} Your code is currently using wp_ajax_{$action} -> wp_ajax_nizam_handler which will restrict the request to logged in (authenticated users). If you are logged out at the time of the request, you will never make it into your callback. If you want to target logged … Read more

Most efficient way to use classes to create admin pages using Settings API

The example in Settings API documentation uses admin_init and admin_menu for registering custom settings and admin pages. https://developer.wordpress.org/plugins/settings/custom-settings-page/ There’s also an old Codex entry on actions typically run on front and back end requests, which can help pick a suitable action hook. https://codex.wordpress.org/Plugin_API/Action_Reference I also highly recommend the excellent old Q&A about instantiating classes in … Read more

How can I make 2 plugins that include different versions of a framework to both use the latest version?

This is serious problem with WordPress and composer. Whatever you do, you are just asking for future problems and/or making life hard for your plugin users. Guess what – even if you manage to load correct version of framework for all your plugins, WP user may unknowingly install some other plugin, which also uses the … Read more

Gutenberg block can’t save richtext

Couple of things to try – remove some of the curly braces { } because those are only needed when you’re referring to variables, and try just directly calling onChange: <div className={‘caption’}> <RichText tagName=”p” className=”imgCtaContent” onChange={ ( content ) => { setAttributes( { content } ) } } value={content} placeholder=”Enter text…” /> </div> Also in … Read more