Get a default value of the Customizer setting using wp.customize API (JS)

It would make sense for the default value to be available via: wp.customize.instance( ‘slug_awesome_title’ ).default Or equivalently: wp.customize( ‘slug_awesome_title’ ).default However, I can see the default is simply not getting exported from PHP to JS. I can see that this is going to be needed in core also when client-side templating replaces server-side rendering of … Read more

Store regex expression in WordPress DB using Options API

WordPress by default “escapes” all slashes and quotes in all input (historical reason, relic of the time PHP could have been configured to do it by default, or not). If you are handling forms by yourself instead of using the APIs you will need to strip the slashes, probably best to be done when saving … Read more

Adding Images into API

from the support forum of that plugin: Your cpt may not be registered correctly. Try adding this to your functions.php (change “event” to your post type slug): add_filter( ‘register_post_type_args’, function( $args, $post_type ) { if( ‘event’ === $post_type ) { $args[‘show_in_rest’] = true; } return $args; }, 10, 2 ); or make sure that you … Read more