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 ( ! function_exists('generate_concerts_post_type') ) { | |
// Register Custom Post Type | |
function generate_concerts_post_type() { | |
$labels = array( | |
'name' => _x( 'Concerts', 'Post Type General Name', 'ale' ), | |
'singular_name' => _x( 'Concert', 'Post Type Singular Name', 'ale' ), | |
'menu_name' => __( 'Concerts', 'ale' ), |
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( 'customize_register', 'kirki_hooks_customize_register' ); | |
function kirki_hooks_customize_register( $wp_customize ) { | |
class Kirki_Customize_Control_Repeater_Setting extends WP_Customize_Setting { | |
/** | |
* In Repeater, one setting is one row full of settings | |
* fields save all the fields and their types |
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', 'theme_enqueue_styles' ); | |
function theme_enqueue_styles() { | |
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.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 | |
add_filter( 'psts_setting_checkout_url', 'katarzyna_nbt_pro_sites_checkout_url' ); | |
function katarzyna_nbt_pro_sites_checkout_url( $value ) { | |
global $pagenow, $psts; | |
if ( ! is_object( $psts ) ) | |
return $value; | |
$show_signup = $psts->get_setting( 'show_signup' ); |
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 ignacio_import_hack( $value ) { | |
if ( ! post_type_exists( 'et_pb_layout' ) ) { | |
register_post_type( 'et_pb_layout' ); | |
} | |
if ( ! taxonomy_exists( 'layout_type' ) ) { | |
register_taxonomy( 'layout_type', 'et_pb_layout' ); | |
} |
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_shortcode( 'areas', 'custom_query_shortcode' ); | |
function custom_query_shortcode( $atts ) { | |
// EXAMPLE USAGE: | |
// [areas show_posts="100" post_type="page" post_parent="246"] | |
// Defaults | |
$defaults = array( | |
"show_posts" => 100, | |
"post_type" => 'page', |
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( 'network_after_site_new_form', function() { | |
$themes = wp_get_themes(); | |
?> | |
<table class="form-table"> | |
<tr class="form-field"> | |
<th scope="row"><label for="my-plugin-theme">Select your theme</label></th> | |
<td> | |
<select name="my-plugin-theme" id="my-plugin-theme"> |
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 | |
// This should add a new option in the form feed but it doesn't anymore because the action has dissappeared | |
add_action( 'gform_user_registration_add_option_section', 'nbt_add_blog_templates_user_registration_option', 15 ); | |
function nbt_add_blog_templates_user_registration_option( $config ) { | |
// I don't know if this would be valid in the new version | |
$multisite_options = rgar($config['meta'], 'multisite_options'); | |
$my_option = rgar( $multisite_options, 'blog_templates' ); | |
?> | |
<input type="checkbox" id="gf_user_registration_multisite_blog_templates" name="gf_user_registration_multisite_blog_templates" value="1" <?php checked( rgar( $multisite_options, 'blog_templates' ) ); ?> /> | |
<?php |
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 | |
$args = array( | |
'post_type' => 'clips', | |
'ignore_sticky_posts' => true, | |
'posts_per_page' => 1, | |
'cat' => 6 | |
); | |
$clips_query = new WP_Query( $args ); |
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
add_action( 'pre_get_posts', 'order_conciertos_by_date' ); | |
function order_conciertos_by_date( $query ) { | |
if ( is_admin() ) | |
return; | |
if ( $query->get( 'post_type' ) != 'concierto' ) | |
return; | |
$today = current_time( 'timestamp' ); | |
$today = date( 'Ymd', $today ); |