#Русское «дело Дрейфуса»
Автор: Федор Крашенинников, специально для «Кашина»
Об авторе:
- общественный деятель,
- политолог,
- писатель,
- публицист.
//Add custom taxonomy for attachments (for using in Library section) | |
add_action( 'init', 'create_attachmentcat_taxonomy', 0 ); | |
function create_attachmentcat_taxonomy() | |
{ | |
$labels_att_cats = array( | |
'name' => _x( 'Категории медиафайлов', 'taxonomy general name' ), | |
'singular_name' => _x( 'Категория медиафайлов', 'taxonomy singular name' ), | |
'search_items' => __( 'Искать в категориях медиафайлов' ), | |
'all_items' => __( 'Все категории медиафайлов' ), |
<?php | |
$metaValue = get_post_meta($post->ID, 'sudexmb_regs_address', true); | |
if ($metaValue) {echo '<div class="contact">'.$metaValue.'</div>';} | |
?> |
//Add an URL variable (such as `/?opened=true`, check if exists with `get_query_var('opened')`) | |
function add_query_vars_filter( $vars ){ | |
$vars[] = "allevents"; | |
// $vars[] = "my_var2"; | |
return $vars; | |
} | |
add_filter( 'query_vars', 'add_query_vars_filter' ); |
/*embedded via https://rawgithub.com/*/ | |
#franklin {border:2px solid red; text-align:center;} |
#Русское «дело Дрейфуса»
Автор: Федор Крашенинников, специально для «Кашина»
Об авторе:
// Remove visual editor from a custom post type editing page | |
function remove_editor_init() { | |
//remove editor for all registries | |
remove_post_type_support('registry', 'editor'); | |
//remove editor for pages whose parent page id is 321 | |
if (isset($_GET['post'])) { | |
$post_id = $_GET['post']; | |
} else if (isset($_POST['post_ID'])) { | |
$post_id = $_POST['post_ID']; |
function pw_show_image_sizes($sizes) { | |
$sizes['partner-logos'] = __( 'Логотипы партнеров', 'sudex' ); | |
// $sizes['pw-large'] = __( 'Custom Large', 'sudex' ); | |
return $sizes; | |
} | |
add_filter('image_size_names_choose', 'pw_show_image_sizes'); |
<?php $myopts = get_option( 'my_option_name', '' ); ?> | |
<div class="slogan" title="<?php echo $myopts['slogan_translate']; ?>"> |
//Show all shortcodes in a menu, from here https://tinyurl.com/lbuespy | |
add_action('media_buttons','add_sc_select',11); | |
function add_sc_select(){ | |
global $shortcode_tags; | |
/* ------------------------------------- */ | |
/* enter names of shortcode to exclude below */ | |
/* ------------------------------------- */ | |
$exclude = array("wp_caption", "embed", "caption", "audio", "video", "gallery", "file_modified", "rwmb_meta", "p2p_connected", "p2p_related", "p2p_related"); | |
echo ' <select id="sc_select"><option>Shortcode</option>'; | |
foreach ($shortcode_tags as $key => $val){ |
//Repeats same value for up to 4 properties | |
@mixin repeat-value($val, $prop1,$prop2,$prop3:'',$prop4:'') { | |
#{$prop1}:$val; | |
#{$prop2}:$val; | |
@if $prop3 != '' {#{$prop3}:$val;} | |
@if $prop4 != '' {#{$prop4}:$val;} | |
} |