This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success": true, | |
"data": { | |
"show_in_rest": true, | |
"show_in_graphql": true, | |
"singular": "Person", | |
"plural": "Persons", | |
"slug": "person", | |
"api_visibility": "private", | |
"model_icon": "dashicons-admin-post", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Create a WP_REST_Response that uses ACM response data formatting. | |
* | |
* @param bool $success Whether the response was successful or not. | |
* @param array $data The data for the response. | |
* @param int $status Optional http status code. Default 200. | |
* @param array $headers Optional http headers. Default empty array. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success": true, | |
"data": { | |
"name": "John Doe", | |
"username": "johndoe123" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"code": "name", | |
"message": "Name is required", | |
"data": { | |
"status": 400 | |
}, | |
"additional_data": [ | |
{ | |
"status": 400 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"success": false, | |
"data": { | |
"name": [ | |
"Name is required", | |
"A second Name error message", | |
"A third Name error message" | |
], | |
"email": [ | |
"Email is required" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Callback for WordPress 'pre_get_posts' action. | |
* | |
* If doing a search, set the post type to 'post'. | |
* | |
* @author Ryan Meier http://www.rfmeier.net/ | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //* do not include php tag | |
/** | |
* Callback for WordPress register_meta() sanitize parameter. | |
* | |
* Sanitize the 'sample_count' meta value before saved to the database. | |
* | |
* @see https://codex.wordpress.org/Function_Reference/register_meta | |
* | |
* @uses absint() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- The parent 'SportsActivityLocation' element, however you may structure it --> | |
<div itemscope itemtype="http://schema.org/SportsActivityLocation"> | |
<!-- | |
Some other possible elements. | |
--> | |
<span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"> | |
<!-- Display coordinate data if you wish... --> | |
<meta itemprop="latitude" content="-33.0000" /> | |
<meta itemprop="longitude" content="18.0000" /> | |
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init' , 'jspt_init'); | |
/** | |
* Callback for WordPress 'init' action. | |
* | |
* Reigster the custom shortcode. | |
* | |
* @return void | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Do not include php tags | |
*/ | |
add_filter( 'posts_groupby', 'custom_posts_groupby', 10, 2 ); | |
/** | |
* Callback for WordPress 'posts_groupby' filter. | |
* | |
* Set the GROUP BY clause to post IDs. |
NewerOlder