This file contains hidden or 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: Pixel Jar — Beaver Builder Admin Column | |
| * Description: Adds a column to the post list table for every post type with Beaver Builder enabled, showing whether the builder is active on each post. | |
| * Author: Pixel Jar | |
| * Author URI: https://www.pixeljar.com | |
| * Version: 1.0 | |
| * License: GPL2 | |
| * Text Domain: pj | |
| * |
This file contains hidden or 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: PJ - Remove Kadence Software Manager Menu | |
| * Description: Removes the "lw-software-manager" top-level admin menu added by Kadence. | |
| * Author: Pixel Jar | |
| * Author URI: https://pixeljar.com | |
| * Version: 1.0.0 | |
| */ | |
| defined( 'ABSPATH' ) || exit; |
This file contains hidden or 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
| ### Keybase proof | |
| I hereby claim: | |
| * I am brandondove on github. | |
| * I am brandondove (https://keybase.io/brandondove) on keybase. | |
| * I have a public key ASDkveaEeqc9F6AbCpZ3edOFnzCY3-LDYPLqCyzQOUTNAAo | |
| To claim this, I am signing this object: |
This file contains hidden or 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 | |
| /** | |
| * POST to endpoint /wp-json/my-custom-endpoint/v1/save-string | |
| * | |
| * Send a string and use "Application Passwords" plugin and save to option | |
| */ | |
| add_action( 'rest_api_init', 'my_custom_endpoint', 10 ); | |
| /** |
This file contains hidden or 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 | |
| /* | |
| * There are many different actions you might | |
| * hook into to trigger a post to your microservice | |
| */ | |
| add_action( 'sample_action', 'post_to_microservice', 10 ); | |
| function post_to_microservice() { |
This file contains hidden or 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 | |
| /** | |
| * Allows you to run new code during the custom post type registration | |
| * | |
| * @return void | |
| */ | |
| function example_ads_init() { | |
| register_taxonomy( | |
| 'ads-formats', |
This file contains hidden or 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 | |
| // Hook into WordPress before the query runs | |
| add_action( 'pre_get_posts', 'pj_sort_it_better' ); | |
| // Modifies the WP_Query object | |
| function pj_sort_it_better( $query ) { | |
| if ( is_page( 'The Page Name' ) ) { | |
This file contains hidden or 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 | |
| // Hook into the init action | |
| add_action( 'wp', 'pj_check_page' ); | |
| // Checks to see if the page we want is being requested and adds a filter to any queries that run on the resulting page | |
| function pj_check_page () { | |
| if ( is_page( 'The Page Name' ) ) { | |
| // for pagination |
This file contains hidden or 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 | |
| /** | |
| * Allows you to modify the css classes that are applied to an ad unit so you can style each unit individually | |
| */ | |
| function example_adsanity_post_class( $classes = array(), $post = false ) { | |
| // Adds a dynamic class that utilizes data from the post object | |
| if ( FALSE !== $post && $post instanceof WP_Post ) { | |
| $classes[] = sprintf( 'custom-%d', $post->ID ); | |
| } |
This file contains hidden or 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 | |
| /** | |
| * Allows you to modify any part of the custom post type registration | |
| * | |
| * see: https://codex.wordpress.org/Function_Reference/register_post_type | |
| */ | |
| function example_ads_setup( $args = array() ) { | |
| // Change the permalink structure for the custom post type | |
| $args['rewrite'] = array( |
NewerOlder