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 | |
/** | |
* Add date/time picker field to Timeline Express announcements | |
* | |
* @param array $custom_field Array of custom fields to append to our announcements. | |
*/ | |
function add_custom_fields_to_announcements( $custom_fields ) { | |
$custom_fields[] = array( | |
'name' => esc_html__( 'Announcement Date & Time', 'text-domain' ), |
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
/** | |
* Timeline Express Add Custom Metabox | |
* @param array $options Array of options for Timeline Express. | |
*/ | |
function define_custom_excerpt_metabox( $options ) { | |
$announcement_custom_metabox = new_cmb2_box( array( | |
'id' => 'custom_meta', | |
'title' => __( 'Additional Announcement Meta', 'text-domain' ), | |
'object_types' => array( 'te_announcements' ), // Post type | |
'context' => 'advanced', |
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 | |
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' ); | |
function my_enqueue_assets() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); | |
wp_enqueue_style( 'animate-css', get_stylesheet_directory_uri() . '/animate.min.css' ); | |
} |
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 | |
/** | |
* Export Class to help export a given database table to CSV. | |
*/ | |
class TOOL_EXPORT_CLASS { | |
/* | |
* Export our forms | |
* @parameters | |
* @table_name the name of the table to export |
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
<table class="widefat fixed" cellspacing="0"> | |
<thead> | |
<tr> | |
<th id="cb" class="manage-column column-cb check-column" scope="col"></th> <!-- this column contains checkboxes --> | |
<th id="columnname" class="manage-column column-columnname" scope="col"></th> | |
<th id="columnname" class="manage-column column-columnname num" scope="col"></th> <!-- "num" added because the column contains numbers --> | |
</tr> | |
</thead> |
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 | |
add_action( 'admin_enqueue_scripts', 'admin_print_js' ); | |
public function admin_print_js() { | |
global $wp_locale; | |
//add the jQuery UI elements shipped with WP | |
wp_enqueue_script( 'jquery' ); | |
wp_enqueue_script( 'jquery-ui-datepicker' ); |
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 | |
add_action('init', 'prefix_add_user'); | |
function prefix_add_user() { | |
$username = 'username123'; | |
$password = 'azerty321'; | |
$email = '[email protected]'; |
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 | |
/* | |
* Enable drag & drop sorting on default WordPress taxonomies (ie: categories) - (page/post) | |
*/ | |
add_filter( 'register_taxonomy_args' , 'add_tax_position_support', 9999, 3 ); | |
function add_tax_position_support( $args, $taxonomy, $object_type ) { | |
if( 'category' == $taxonomy ) { | |
$args['tax_position'] = true; | |
} |
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 | |
/* | |
* If you've registered a custom taxonomy to assign to one of your custom post types, | |
* you'll want to add an additional paprameter to the $args array | |
* | |
*/ | |
// Register Custom Taxonomy | |
function custom_taxonomy() { |
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 | |
// when copying, do not include lines 1 & 2 | |
// Create the function to use in the action hook | |
function yikes_remove_stats_dashboard_widget() { | |
// Check user capabilities | |
if( ! current_user_can( 'manage_options' ) ) { | |
// Remove the stats metabox | |
remove_meta_box( 'yikes_easy_mc_list_stats_widget', 'dashboard', 'normal' ); | |
// Remove the list activity metabox |