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 upload_hint() { | |
global $common_config; | |
$adminscreen = get_current_screen(); | |
echo '<p>'; | |
_e('Consider uploading images of at least 1050 pixels in width.','site'); | |
echo '</p>'; |
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 tiny_mce_remove_unused_buttons_row_1($buttons) { | |
$remove = array('wp_more', 'aligncenter', 'alignleft', 'alignright'); | |
return array_diff($buttons,$remove); | |
} | |
add_filter('mce_buttons','tiny_mce_remove_unused_buttons_row_1'); | |
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 placeholder text to an office title | |
function change_placeholder_text_offices($title){ | |
$screen = get_current_screen(); | |
if ( $screen->post_type == 'office' ) { | |
$title = 'Enter city name here'; | |
} | |
return $title; | |
} |
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 acf_add_wysiwyg_toolbar($toolbars) { | |
$toolbars['Bare'] = array(); | |
$toolbars['Bare'][1] = array('bold', 'italic', 'link', 'unlink', 'removeformat'); | |
return $toolbars; | |
} | |
add_filter('acf/fields/wysiwyg/toolbars', 'acf_add_wysiwyg_toolbar'); |
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 | |
// Disable "Custom fields" menu in admin | |
add_filter('acf/settings/show_admin', '__return_false'); |
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 set_mce_editor_placeholder_question($textarea_html) { | |
if ('question' !== get_post_type()) return $textarea_html; | |
$placeholder = __( 'Please enter some text as the question...', 'site_domain'); | |
$textarea_html = preg_replace( '/<textarea/', "<textarea placeholder=\"{$placeholder}\"", $textarea_html ); | |
return $textarea_html; |
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 | |
// Modify TinyMCE editor to remove H1 and add some other options | |
function tiny_mce_remove_unused_formats_formatselect($init) { | |
$init['block_formats'] = 'Paragraph=p;Heading 2=h2;Heading 3=h3;Heading 4=h4;Heading 5=h5;Heading 6=h6'; | |
return $init; | |
} | |
add_filter('tiny_mce_before_init', 'tiny_mce_remove_unused_formats_formatselect' ); |
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 | |
// hide support for certain admin "features" (metaboxes) for some pages | |
function hide_features() { | |
if ( isset($_GET['action']) && $_GET['action'] === 'edit' ) { | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID']; | |
if( !isset( $post_id ) ) return; | |
$templated_pages_names = array( | |
// 'template-contact.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 | |
// Remove unnecessary sections from the theme customizer | |
function edit_customizer($wp_customize) { | |
$wp_customize->remove_section("colors"); | |
$wp_customize->remove_section("custom_css"); | |
// $wp_customize->remove_section("static_front_page"); | |
} | |
add_action( "customize_register", "edit_customizer" ); |
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
function polylang_languageswitcher_untranslated_pts_archives_links_fix( $url, $slug ) { | |
if ( is_post_type_archive( array('event', 'career') ) ) { | |
$url = add_query_arg( | |
array( | |
'post_type' => get_post_type(), | |
), | |
pll_home_url( $slug ) | |
); | |
} |