Loading scripts to the Post Edit page only

I have added a few meta boxes for the posts and pages, so I want to load a js script only on the Create/Edit post and page. How can I do that? Currently I’m using following but that loads the scripts in all pages in the admin. function my_meta_boxes() { add_meta_box(“post_meta”, “Meta”, “post_meta”, “post”, “normal”, … Read more

wp_editor in metabox not working

So, I’ve created a meta box within my page to allow my client to be able to add content into multiple different content blocks dynamically. I’ve done that using the wp_editor function like so. function what_we_believe_meta($post, $args) { $what_we_believe = get_post_meta($post->ID, ‘what_we_believe’, true); echo ‘</br>’; wp_editor( $what_we_believe, ‘what_we_believe’); } The problem that I’m running into … Read more

Dynamically adding WYSIWYG to metaboxes

I’ve created a custom metabox area and need to add the option of multiple metaboxes. So far I found this guide https://jeremyhixon.com/repeating-wordpress-editor/ which works absolutely perfect up until one point. When you click to add a new metabox it dynamically adds the textarea and turns it into a tinyMCE using tinymce.init({ selector: ‘#’ + contentID … Read more

Best choice of options/settings framework for plugin/theme development

My question is what is the best options/settings framework out there now to safely build custom plugin/theme upon? I found the similar question here, but it was asked 7 years ago and definitely, things changed from that time. I used ACF a lot to manage custom meta fields and creating theme options page. The plugin … Read more

Adding Meta Boxes while Registering a Post Type in a Class

I am trying to add a few meta boxes for a Custom Post Type through a Class. I am using the “register_meta_box_cb” parameter while registering the Custom Post Type to specify the callback function for adding meta boxes. Sample code – (outline of my code) – class ABC { public static function add_customposttype() { $abc_o … Read more