Basic input masks use symbols to create the mask.
9
: Numerica
: AlphabeticalA
: Alphabetical (forces uppercase)*
: Alphanumeric&
: Alphanumeric (forces uppercase)
<?php | |
/** | |
* Disable the "foo" custom post type feed | |
* | |
* @since 1.0.0 | |
* @param object $query | |
*/ | |
function ja_disable_cpt_feed( $query ) { | |
if ( $query->is_feed() && in_array( 'foo', (array) $query->get( 'post_type' ) ) ) { | |
die( 'Feed disabled' ); |
<?php | |
/** | |
* WPForms custom redirect | |
* | |
* @param string $url URL form will redirect to | |
* @param int $form_id Form ID | |
* @param array $fields Submitted form fields | |
* @return string | |
*/ | |
function wpf_custom_redirect( $url, $form_id, $fields ) { |
<?php | |
/** | |
* Add external links to the admin menu | |
*/ | |
add_action( 'admin_menu' , 'ja_new_admin_menu_items' ); | |
function ja_new_admin_menu_items() { | |
global $submenu; | |
$url = get_bloginfo('url'); | |
/** |
jQuery(document).ready(function($){ | |
function mobile_combine_nav() { | |
$('.nav-header li.secondary-item').remove(); | |
if ( $('.nav-secondary').css( 'display' ) == 'none' ) { | |
$('.nav-secondary li').addClass('secondary-item').clone().appendTo('.nav-header ul'); | |
} | |
} | |
mobile_combine_nav(); | |
$(window).resize(mobile_combine_nav); | |
}); |
<?php | |
/** | |
* Preselect dropdown field based on URL parameter. | |
* | |
* @param array $field | |
* @param array $field_atts | |
* @param array $form_data | |
* @return array | |
*/ | |
function wpf_preselect_dropdown( $field, $field_atts, $form_data ) { |
<?php | |
/** | |
* Remove 'hentry' from post_class() | |
*/ | |
function ja_remove_hentry( $class ) { | |
$class = array_diff( $class, array( 'hentry' ) ); | |
return $class; | |
} | |
add_filter( 'post_class', 'ja_remove_hentry' ); |
<?php | |
/** | |
* Custom shortcode to display WPForms form entries count for a form. | |
* | |
* Basic usage: [wpf_entries_count id="FORMID" type="TYPE"]. | |
* | |
* @param array $atts Shortcode attributes. | |
* | |
* @return string | |
*/ |
Enable PHP logging in MAMP Pro, under the PHP settings (screenshot)
Inside your MAMP Sites
directory (or equivalent), create a new directory pimpmylog
Create a new host, such as phplog.local
, in MAMP for easy access (screenshot)
<?php | |
/** | |
* Redirect taxonomy to use custom post type archive template | |
* | |
* @author Jared Atchison | |
* @link http://jaredatchison.com/code/ | |
* @param string $template | |
* @return string | |
*/ | |
function ja_template_redirect( $template ) { |