Vagrantpress + composer

Unfortunately you can’t use Vagrantpress and Composer directly together easily. Half of Vagrantpress is the WordPress setup itself which isn’t compatible. If you still wanted to leverage the base work Vagrantpress has done with PHP, Apache, MySQL etc, you could fork it and modify their WP module found here: https://github.com/chad-thompson/vagrantpress/blob/master/puppet/modules/wordpress/manifests/init.pp It would still require a … Read more

Why aren’t tags and categories added in post request to WP Rest API

You are using name in your terms. In default, try to use the existing term id ( in your case, cat ID and tag ID ). If you see https://plugins.trac.wordpress.org/browser/rest-api/trunk/lib/endpoints/class-wp-rest-posts-controller.php#L918 they will handle your term with sanitize them into non-negative integer using absint. I hope this help. Here example code to hook rest_insert_{$this->post_type} to create … Read more

Parsing php string in jquery [closed]

Well it seems @JacobPeattie mentioned to use json, I just echoing that. First json encode the variable $array = json_encode($out); Then send this value echo ‘<div data-ad = ‘.$array.’ class=”ash_loadmore”><span>LOAD MORE</span></div>’; To get that echo json_encode($_POST[‘ad’]) I think that’s it.BTW you don’t have now that string problem as the output will be like this {“footer-insta”:2,”sidebar-1″:3} … Read more

Where to access the available plugin/WordPress updates?

Plugin update data is cached in the update_plugins site transient with available updates under the response property. $data = get_site_transient( ‘update_plugins’ ); var_dump( $data->response ); Response looks a bit like: array(1) { [“wordpress-seo/wp-seo.php”]=> object(stdClass)#1873 (11) { [“id”]=> string(27) “w.org/plugins/wordpress-seo” [“slug”]=> string(13) “wordpress-seo” [“plugin”]=> string(24) “wordpress-seo/wp-seo.php” [“new_version”]=> string(5) “5.5.1” [“url”]=> string(44) “https://wordpress.org/plugins/wordpress-seo/” [“package”]=> string(62) “https://downloads.wordpress.org/plugin/wordpress-seo.5.5.1.zip” [“icons”]=> … Read more

Customize JSON output

This code will do the job: $args = array( ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => -1, ); $query = new WP_Query( $args ); $posts = array(); $categories = array(); $json = array(); while( $query->have_posts() ) : $query->the_post(); $post_categories = get_the_category(); $post_category = current($post_categories); $categories[] = array( ‘name’ => $post_category->name ); $posts[] = array( … Read more