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
wp.blocks.registerBlockStyle( 'core/image', { | |
name: 'phader', | |
label: 'Philly Phader' | |
} ); |
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 lines five to 10 to your child theme's functions.php file | |
*/ | |
function change_category_order( $query ) { | |
if ( $query->is_category('8') && $query->is_main_query() ) { | |
$query->set( 'order', 'ASC' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'change_category_order' ); |
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_action( 'pre_get_posts', 'custom_reverse_post_order' ); | |
function custom_reverse_post_order( $query ) { | |
if ( is_admin() ) | |
return; | |
if ( $query->is_main_query() && is_archive() && ! is_post_type_archive() && ($query->query_vars['category_name'] == 'category-name' || $query->query_vars['category_name'] == 'category-name') ) { | |
$query->set( 'orderby', 'date' ); | |
$query->set( 'order', 'ASC' ); | |
} | |
} |
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 in PMPro Customizations plugin | |
/** | |
* Have members use their email address for logging in to your website powered with Paid Memberships Pro | |
* | |
* Paste the code below into a PMPro Customization Plugin: | |
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
add_filter( 'gettext', 'wordpress_login_gettext', 20, 3 ); | |
function wordpress_login_gettext( $translated_text, $text, $domain ) { |
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 this or the doc block if adding to a Customizations plugin | |
/** | |
* Add this to its own folder in your plugins directory or copy the code below this doc block to a Customizations Plugin and customize to suit your needs. | |
* | |
* Plugin Name: PMPro Register Helper Examples | |
* Description: Create a folder name in your plugins' folder with the same name as this filename, but without the .php extension. Save this file in that folder and then you can activate this plugin in your WordPress dashboard, | |
* Author: pbrocks | |
* Author URI: https://github.com/pbrocks | |
*/ |
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( 'wp_enqueue_scripts', 'wps_load_scripts' ); | |
/** | |
* Enqueue Isotope | |
* For commercially developed child themes, you must obtain a license | |
* from isotope.metafizzy.co for approx. $25. | |
* | |
* @author Travis Smith | |
* @link http://wpsmith.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
add_filter( 'ssp_episode_meta_details', 'ssp_remove_download_link', 10, 3 ); | |
function ssp_remove_download_link ( $meta, $episode_id, $context ) { | |
unset( $meta['link'] ); | |
return $meta; | |
} |
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 | |
/* | |
Only allow users to use the trial level once. | |
Add this code to your active theme's functions.php | |
or a custom plugin. | |
Be sure to change the $trial_level_id variable in multiple places. | |
*/ | |
//record when users gain the trial level | |
function my_pmpro_after_change_membership_level($level_id, $user_id) | |
{ |
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 | |
/** | |
* Change membership level for users expiring from startup level, moving them to primary level. | |
* Users can cancel their membership level after their before or after the membership level change. | |
*/ | |
function wbon_change_default_level_when_expiring_startup( $user_id, $level_id ) { | |
global $wpdb; |
NewerOlder