Does it still make sense using json endpoint ep_mask now that there’s the new rest api? [closed]

I think you should stop using rewrite endpoints to handle JSON responses. Instead you can and you should use the REST API. So, instead of this: function makeplugins_add_json_endpoint() { add_rewrite_endpoint( ‘json’, EP_PERMALINK | EP_PAGES ); } add_action( ‘init’, ‘makeplugins_add_json_endpoint’ ); And then handle the JSON response at your own, you can and you should do … Read more

are there any initiatives to work wordpress as microservices?

No, without going into too much ranting, the wordpress core philosophy is based on user experience and API stability, this kind of restructuring is impossible without “breaking some eggs” so I don’t imagine core wordpress to go that direction in any time soon. In addition, it doesn’t make much sense for anything smaller than google/amazon/facebook … Read more

How to run select query of post with category and tags for API?

WordPress already has an API you can extend, and a class for querying posts! For example: // when the rest_api_init action/event happens add_action( ‘rest_api_init’, function () { // register a new endpoint register_rest_route( ‘mohnish/v1’, ‘/posts/’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘mohnish_awesome_func’, // that calls this function ) ); } ); // this is whats … Read more

Create new post with meta data using WordPress API

You need to register your meta field first, then you can insert / update it into a post using rest api. https://codex.wordpress.org/Function_Reference/register_meta $object_type=”post”; $args1 = array( ‘type’ => ‘string’, ‘description’ => ‘My Meta Key Description’, ‘single’ => true, ‘show_in_rest’ => true, ); register_meta( $object_type, ‘MyMetaKey’, $args1 ); Hope it helps

CMB2 Repeatable Group & JSON API

Consider using the CMB2 API. <SITE_URL>/wp-json/cmb2/v1/boxes/<METABOX_ID>/fields/PhotoGalleryGroup?object_id=<POST_ID>&object_type=post You will need to enable the API feature for your box/fields. Documentation for that is in the wiki.

Change the CSS of the Customizer API

Definitely, you can use the customize_controls_enqueue_scripts hook to load custom CSS and JS. This is an example of making the panel 400px: File: sample-theme/css/customizer-controls.css .wp-full-overlay.expanded { margin-left: 400px; } .wp-full-overlay-sidebar { min-width: 400px; } .wp-full-overlay.collapsed .wp-full-overlay-sidebar { margin-left: -400px; } File: sample-theme/functions.php /** * Enqueue style for customized customizer. */ function sample_theme_customize_enqueue() { wp_enqueue_style( ‘custom-customize’, … Read more