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
<div data-bind="page: { id: '?', nameParam: postTypeName }"> | |
<h3><?php _e( 'Editing:', $this->plugin_slug ); ?> <span class="text-success" data-bind="text: label"></span></h3> | |
<ul class="nav nav-tabs" data-bind="foreach: $page.children"> | |
<li data-bind="css: {active: isVisible}"><a data-bind="text: $data.val('title'), page-href: $data"></a></li> | |
</ul> | |
<div class="tab-pane" data-bind="page: { id: 'general', title: '<?php _e( 'General', $this->plugin_slug ); ?>' }"> | |
<?php include_once( 'posttypes/edit-tab-general.php' ); ?> | |
</div> | |
<div class="tab-pane" data-bind="page: { id: 'features', title: '<?php _e( 'Features', $this->plugin_slug ); ?>' }"> | |
<?php include_once( 'posttypes/edit-tab-features.php' ); ?> |
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_filter( 'shortcode_atts_gallery', 'extend_gallery_attributes', 10, 3 ); | |
function extend_gallery_attributes( $out, $pairs, $atts ) { | |
// var_dump( $out ); | |
// var_dump( $pairs ); | |
// var_dump( $atts ); | |
$attachmentArgs = array( | |
'post_type' => 'attachment', | |
'posts_per_page' => 5 |
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 | |
/** | |
* Loop through an array of shortcodes and check for their existence | |
* @author Gabe Shackle <gabe@hereswhatidid.com> | |
* @param array $shortcodes An array of shortcode strings | |
* @param boolean $match_all Whether to check for the existence of ALL the shortcodes, or just ANY of them | |
* @return mixed The results will either be an array of the found shortcodes or boolean false | |
*/ | |
function shortcodes_exist( $shortcodes = array(), $match_all = false ) { | |
$found_shortcodes = array(); |
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
<div class="col-lg-4" data-bind="selectWithOther: query_var, selectWithOtherOptions: { selectField: '#post-type-query_var', textField: '#post-type-query_var_text' }"> | |
<label for="post-type-query_var"><?php _e( 'Query Variable', $this->plugin_slug ); ?></label> | |
<select id="post-type-query_var" class="form-control"> | |
<option value="true"><?php _e( 'Default', $this->plugin_slug ); ?></option> | |
<option value="false"><?php _e( 'None', $this->plugin_slug ); ?></option> | |
<option value="other"><?php _e( 'Custom', $this->plugin_slug ); ?></option> | |
</select> | |
<span class="help-block"><?php _e( 'Sets the query_var key for this post type.', $this->plugin_slug ); ?></span> | |
</div> | |
<div class="col-lg-4"> |
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 | |
protected function getCardType( $ccNum ) { | |
if (preg_match("/^5[1-5][0-9]{14}$/", $ccNum)) | |
return "Mastercard"; | |
if (preg_match("/^4[0-9]{12}([0-9]{3})?$/", $ccNum)) | |
return "Visa"; | |
if (preg_match("/^3[47][0-9]{13}$/", $ccNum)) | |
return "American Express"; |
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 | |
array ( | |
'key' => 'field_56bde9a0ea676', | |
'label' => 'Email', | |
'name' => 'email', | |
'type' => 'email', | |
'instructions' => '', | |
'required' => 0, | |
'conditional_logic' => 0, | |
'wrapper' => array ( |
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
@media(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { | |
/* Retina-specific stuff here */ | |
} |
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 | |
// ---------------------------------------------------------------------------------------------------- | |
// - Display Errors | |
// ---------------------------------------------------------------------------------------------------- | |
ini_set('display_errors', 'On'); | |
ini_set('html_errors', 0); | |
// ---------------------------------------------------------------------------------------------------- | |
// - Error Reporting |
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 | |
function hwid333_add_custom_attribute_columns( $fields ) { | |
$fields[] = array( | |
'slug' => 'shirt-size', | |
'name' => 'Shirt Size', // This is the name of the column in the CSV | |
); | |
$fields[] = array( |