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&remove field from user profiles - sorce:http://davidwalsh.name/add-profile-fields | |
function modify_contact_methods($profile_fields) { | |
// Add new fields | |
$profile_fields['company'] = 'Company'; | |
// Remove old fields | |
//unset($profile_fields['aim']); | |
return $profile_fields; |
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 | |
//redirect any draft/trashed posts | |
add_action('wp', 'trash_redirect'); | |
function trash_redirect(){ | |
if ( !current_user_can( 'edit_pages' ) ) { | |
if (is_404()){ | |
global $wp_query, $wpdb; | |
$page_id = $wpdb->get_var( $wp_query->request ); | |
$post_status = get_post_status( $page_id ); | |
if($post_status == 'trash' || $post_status == 'draft'){ |
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 | |
/** custom-system-emails.php | |
* | |
* Plugin Name: Custom WordPress System Emails | |
* Plugin URI: http://hallme.com | |
* Description: This plugin custom plugin created for Process Pro to alter the default WordPress System emails. There is no admin section to this plugin so all edits will need to be made in the code. | |
* Version: 0.1 | |
* Author: Hall Internet Marketing - Tim Howe | |
* Author URI: http://hallme.com | |
* Text Domain: wp-system-emails |
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 | |
/** | |
* truncateHtml can truncate a string up to a number of characters while preserving whole words and HTML tags | |
* | |
* @param string $text String to truncate. | |
* @param integer $length Length of returned string, including ellipsis. | |
* @param string $ending Ending to be appended to the trimmed string. | |
* @param boolean $exact If false, $text will not be cut mid-word | |
* @param boolean $considerHtml If true, HTML tags would be handled correctly | |
* |
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
//sort media library by pdf file type - http://wordpress.org/support/topic/filter-media-library-by-file-type | |
function modify_post_mime_types($post_mime_types) { | |
$post_mime_types['application/pdf'] = array(__('PDF'), __('Manage PDF'), _n_noop('PDF <span class="count">(%s)</span>', 'PDF <span class="count">(%s)</span>')); | |
return $post_mime_types; | |
} | |
add_filter('post_mime_types', 'modify_post_mime_types'); |
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
// Redirect non-admins to the homepage after logging into the site. | |
function nonadmin_login_redirect( $redirect_to, $request, $user ) { | |
return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url() : site_url(); | |
} | |
add_filter( 'login_redirect', 'nonadmin_login_redirect', 10, 3 ); |
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 | |
//Modify the output of the gallery short code | |
add_filter('post_gallery', 'scaffolding_post_gallery', 10, 2); | |
function scaffolding_post_gallery($attr) { | |
$post = get_post(); | |
static $instance = 0; | |
$instance++; | |
if ( ! empty( $attr['ids'] ) ) { |
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 | |
public function plugin_settings_fields() { | |
//collect the forms for the array options | |
$forms = RGFormsModel::get_forms(); | |
$choices = array(); | |
foreach($forms as $form){ | |
$choices[] = array("label" => esc_html($form->title),"value" => absint($form->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
/*Core Media Player*/ | |
.mejs-container { | |
.mejs-controls{ | |
.mejs-button{} | |
.mejs-playpause-button{} | |
.mejs-play{} | |
.mejs-pause{} |
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
DELETE FROM wp_postmeta | |
WHERE post_id IN(SELECT ID FROM wp_posts WHERE post_type = 'shop_order'); | |
DELETE FROM wp_posts WHERE post_type = 'shop_order'; |
OlderNewer