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
// http://imgur.com/LL2tUqW <- db snapshot | |
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID | |
FROM wp_posts | |
INNER JOIN wp_term_relationships | |
ON (wp_posts.ID = wp_term_relationships.object_id) | |
INNER JOIN wp_term_taxonomy | |
ON (wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id) | |
INNER JOIN wp_terms | |
ON (wp_terms.term_id = wp_term_taxonomy.term_id) | |
WHERE 1=1 |
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 | |
use Roots\Sage\Assets; | |
add_filter('wp_enqueue_scripts', 'forms_docs_scripts'); | |
function forms_docs_scripts() { | |
// var_dump(Assets\asset_path('scripts/forms-docs.ajax.js')); | |
wp_enqueue_scripts( 'forms-docs-scripts', Assets\asset_path('scripts/forms-docs.ajax.js'), array('jquery') ); | |
} |
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
// this just prints the modified date of the published post for each revision | |
<?php | |
$args = array( | |
'offset' => 1, | |
'numberposts' => PHP_INT_MAX, | |
); | |
$revisions = wp_get_post_revisions( get_the_id(), $args ); | |
foreach ($revisions as $revision) { | |
setup_postdata( $revision ); | |
?> |
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
add_filter( 'wp_edit_nav_menu_walker', function() {remove_all_filters('wp_edit_nav_menu_walker' );}, 1 ); | |
add_filter( 'wp_edit_nav_menu_walker', array( $this, 'acf_menu_edit_walker'), 1, 2 ); |
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 | |
// https://codex.wordpress.org/Creating_Options_Pages#Example_.232 | |
class VpaMceSettingsPage | |
{ | |
/** | |
* Holds the values to be used in the fields callbacks | |
*/ | |
private $options; | |
/** |
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
setup_postdata( $field ); | |
the_title(); | |
the_content(); | |
wp_reset_postdata(); |
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
// when I test this http://192.168.10.11/wp-json/docs/v1 | |
// I get this. | |
// I only registered this: register_rest_route( 'docs/v1/s' , array() ); | |
// So where in the heck did "/docs/v1/terms/(?P<taxonomy>[\\w-]+)" come from!? | |
{ | |
"namespace": "docs/v1", | |
"routes": { | |
"/docs/v1": { | |
"namespace": "docs/v1", | |
"methods": [ |
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 | |
/* | |
Plugin Name: DCDC Docs Endpoint | |
Description: Exposes the docs/v1 namespace and search endpoint for use by other VPA sites in the network | |
Version: 0.1 | |
Author: Joel Stransky | |
Author URI: https://dcdc.coe.hawaii.edu/ | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { |
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
function acf_get_terms( $args = array() ) { | |
global $wpdb; | |
$defaults = array( | |
'taxonomy_slug' => '', | |
'acf_field_name' => null, | |
'meta_value' => '', | |
); | |
$args = wp_parse_args( $args, $defaults ); | |
if ( empty($args['taxonomy_slug']) || ! taxonomy_exists( $args['taxonomy_slug'] ) || empty( $args['acf_field_name'] ) ) { |
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
[{ | |
"id": 40, | |
"text": "Campus Center" | |
}, { | |
"id": 35, | |
"text": "College of Arts & Humanities" | |
}, { | |
"id": 34, | |
"text": "College of Education (COE)" | |
}, { |