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
function pw_change_archive_order( $query ) { | |
if( $query->is_main_query() && is_archive() ) { | |
$query->set('order', 'ASC'); | |
} | |
} | |
add_action('pre_get_posts', 'pw_change_archive_order'); |
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
$formerprojectnumber = get_post_meta($post->ID, 'ecpt_formerprojectnumber', true); | |
if ( empty( $formerprojectnumber ) || !is_array( $formerprojectnumber ) || $formerprojectnumber == '' ) { | |
echo 'None Entered'; | |
} else { | |
echo $formerprojectnumber; | |
} |
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 | |
function rcp_process_paypal($subscription_data) { | |
global $rcp_options; | |
$paypal_redirect = ''; | |
$paypal_email = $rcp_options['paypal_email']; | |
$listener_url = home_url('/') . '?listener=IPN'; | |
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
IF ( QUERY VAR EXISTS ) { | |
// do not deny all | |
} else { | |
DENY ALL | |
} |
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
/** | |
* Install | |
* | |
* Runs on plugin install. | |
* | |
* @access private | |
* @since 1.0 | |
* @return void | |
*/ |
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 | |
function pw_digitalstore_front_latest_downloads() { | |
$number = 10; // set this to the number of items you want to show | |
digitalstore_latest_downloads( array( 'limit' => $number ) ); | |
} | |
remove_action( 'digitalstore_store_front', 'digitalstore_front_latest_downloads', 2 ); | |
add_action( 'digitalstore_store_front', 'pw_digitalstore_front_latest_downloads', 2 ); |
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
function pw_edd_reverse_gateways( $gateways ) { | |
return array_reverse( $gateways ); | |
} | |
add_filter('edd_payment_gateways', 'pw_edd_reverse_gateways'); |
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
// will show a list of a user's bookmarks | |
function upb_list_bookmarks( $delete_link = true, $delete_text = 'Delete' ) { | |
if(is_user_logged_in()) { | |
$display = '<ul class="upb-bookmarks-list">'; | |
$bookmarks = upb_get_user_meta(upb_get_user_id()); | |
if($bookmarks) { | |
foreach( $bookmarks as $bookmark) { |
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 | |
// Save extra taxonomy fields callback function. | |
function save_taxonomy_custom_meta( $term_id ) { | |
if ( isset( $_POST['term_meta'] ) ) { | |
$t_id = $term_id; | |
$cat_keys = array_keys( $_POST['term_meta'] ); | |
$new_meta = array(); | |
foreach ( $cat_keys as $key ) { | |
if ( isset ( $_POST['term_meta'][$key] ) ) { | |
$new_meta[$key] = $_POST['term_meta'][$key]; |
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
// Edit term page | |
function summit_taxonomy_edit_meta_field($term) { | |
// put the term ID into a variable | |
$t_id = $term->term_id; | |
// retrieve the existing value(s) for this meta field. This returns an array | |
$term_meta = get_option( "taxonomy_$t_id" ); ?> | |
<tr class="form-field"> | |
<th scope="row" valign="top"><label for="term_meta[displayed]"><?php _e( 'Display Category', 'summit' ); ?></label></th> |