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( 'rest_api_init', function() { | |
register_rest_field( | |
array( 'poststatus_partners' ), | |
'partner_meta', | |
array( | |
'get_callback' => 'poststatus_get_restable_field_values_for_partner_meta', | |
'update_callback' => 'poststatus_update_restable_field_values_for_partner_meta', | |
'schema' => null, |
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 | |
/* | |
* WordPress Sample function and action | |
* for loading scripts in themes | |
*/ | |
// Let's hook in our function with the javascript files with the wp_enqueue_scripts hook | |
add_action( 'wp_enqueue_scripts', 'wpcandy_load_javascript_files' ); |
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_filter('wpseo_metabox_prio','krogs_lower_wpseo_metabox', 10 ); | |
function krogs_lower_wpseo_metabox( $priority ) { | |
$priority = 'low'; | |
return $priority; | |
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
.DS_Store | |
node_modules | |
.sass-cache | |
uploads | |
debug.log | |
.css.map | |
themes/* | |
!themes/poststatus/ |
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 echo krogs_output_related_posts(); ?> |
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
Basic docs: http://v2.wp-api.org/ | |
Extending (includes philosophy): http://v2.wp-api.org/extending/adding/ | |
Scott Bolinger has good posts: http://scottbolinger.com/category/wp-api/ | |
And (mostly corresponding) gists: https://gist.github.com/scottopolis/ | |
Good series: https://deliciousbrains.com/tag/wp-rest-api/ | |
Nice eBook intro: https://wpengine.com/blog/wordpress-rest-api-free-ebook/ |
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_shortcode( 'blogle-forum-profile-link', 'blogle_forum_profile_link_shortcode' ); | |
function blogle_forum_profile_link_shortcode() { | |
$link = NULL; | |
if ( is_user_logged_in() ) { | |
$link = '<a href="' . bbp_get_user_profile_url( bbp_get_current_user_id() ) . '" class="blogle-profile-link">My Profile</a>'; |
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
/** | |
* Handles toggling the main navigation menu for small screens. | |
*/ | |
jQuery( document ).ready( function( $ ) { | |
var $masthead = $( '#masthead' ), | |
timeout = false; | |
$.fn.smallMenu = function() { | |
$masthead.find( '.site-navigation' ).removeClass( 'main-navigation' ).addClass( 'main-small-navigation' ); | |
$masthead.find( '.site-navigation h1' ).removeClass( 'assistive-text' ).addClass( 'menu-toggle' ); |
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 | |
function poststatus_get_love_it() { | |
if ( 'post' == get_post_type() ) { | |
$love_output = lip_love_it_link( $post_id = get_the_ID(), $link_text = ' <div class="genericon genericon-collapse"></div> ', $already_loved = '', $echo = false ); | |
return $love_output; | |
} |
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 | |
/* | |
* WP_Query doing_it_wrong | |
* | |
* i'm commenting this so you don't copy / paste this fail sauce | |
*/ | |
$original_query = $wp_query; // YUDOTHAT??? | |
$wp_query = null; // Oh, man |