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 | |
/** | |
* Have WordPress match postname to any of our public post types (post, page, race). | |
* All of our public post types can have /post-name/ as the slug, so they need to be unique across all posts. | |
* By default, WordPress only accounts for posts and pages where the slug is /post-name/. | |
* | |
* @param $query The current query. | |
*/ | |
function gp_add_cpt_post_names_to_main_query( $query ) { |
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 | |
/* | |
* Schedule cron job to automatically mark referrals as paid shortly after a new affiliate is registered | |
*/ | |
function affwp_rcp_schedule_mark_referrals_as_paid_cron() { | |
wp_schedule_event( time() + 60, 'twicedaily', 'affwp_rcp_mark_referrals_as_paid' ); | |
} | |
add_action( 'affwp_insert_affiliate', 'affwp_rcp_schedule_mark_referrals_as_paid_cron' ); |
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
Autos & Vehicles | |
Comedy | |
Education | |
Entertainment | |
Film & Animation | |
Gaming | |
Howto & Style | |
Music | |
News & Politics | |
Nonprofits & Activism |
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: Pagination Fields | |
* Description: Adds next & prev post data to WPGraphQL schema | |
* Version: 0.1.0 | |
* Author: Kellen Mace | |
* Author URI: https://kellenmace.com/ | |
* License: GPLv2 or later | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
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 | |
/** | |
* This class handles downloading a remote image file and inserting it | |
* into the WP Media Library. | |
* | |
* Usage: | |
* $download_remote_image = new KM_Download_Remote_Image( $url ); | |
* $attachment_id = $download_remote_image->download(); | |
* |
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 | |
/** | |
* Enable unfiltered_html capability for Editors. | |
* | |
* @param array $caps The user's capabilities. | |
* @param string $cap Capability name. | |
* @param int $user_id The user ID. | |
* @return array $caps The user's capabilities, with 'unfiltered_html' potentially added. | |
*/ |
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 | |
/** | |
* Get tools, filtered by the taxonomy term, if one was selected. | |
* | |
* @return WP_Query Tools in the taxonomy term if one was selected, else all. | |
*/ | |
function km_get_tools_in_taxonomy_term() { | |
return new WP_Query( 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
<div class="tools-dropdown"> | |
<form id="tool-category-select" class="tool-category-select" method="get"> | |
<?php | |
// Create and display the dropdown menu. | |
wp_dropdown_categories( | |
array( | |
'orderby' => 'NAME', // Order the items in the dropdown menu by their name. | |
'taxonomy' => 'tools', // Only include posts with the taxonomy of 'tools'. |
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 hmc_metaboxes( array $meta_boxes ) { | |
$meta_boxes['home_metabox'] = array( | |
'id' => '_hmc_home_metabox2', | |
'title' => __( 'Key Facts', 'hmc' ), | |
'pages' => array( 'page' ), | |
'show_on' => array( 'key' => 'page-template', 'value' => 'templates/home-page.php' ), | |
'context' => 'normal', | |
'priority' => 'default', |
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
<p>Store Address: <?php echo esc_html( get_post_meta( get_the_ID(), 'store_address', true ) ); ?></p> |