This file contains 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 haysky_disable_admin_bar() { | |
if (current_user_can('administrator') ) { | |
show_admin_bar(true); | |
} else { | |
show_admin_bar(false); | |
} | |
} | |
add_action('after_setup_theme', 'haysky_disable_admin_bar'); |
This file contains 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', function() { | |
if ( is_admin() && ! current_user_can( 'administrator' ) && is_user_logged_in() && ! wp_doing_ajax() ) { | |
wp_redirect( home_url().'/account' ); | |
exit; | |
} | |
}); |
This file contains 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 | |
/*** Sort and Filter Users ***/ | |
add_action('restrict_manage_users', 'filter_by_gender'); | |
function filter_by_gender($which){ | |
// template for filtering | |
$st = '<select name="gender_%s" style="float:none;margin-left:10px;"> | |
<option value="">%s</option>%s</select>'; | |
// generate options |
This file contains 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('manage_users_columns','remove_users_columns'); | |
function remove_users_columns($column_headers) { | |
// if (current_user_can('moderator')) { | |
unset($column_headers['name']); | |
// } | |
return $column_headers; | |
} |
This file contains 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',function(){ | |
global $post; | |
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'mathematics_exam') ) { | |
wp_enqueue_script( 'jquery'); | |
} | |
}); |
This file contains 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
<a href="upi://pay?pa=9999999999@upi&pn=SHAIK MOHAMMAD SUFYAN&am=200&cu=INR">CLICK HERE</a> | |
This file contains 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 ws_preselect_post_category() { | |
if ( isset($_GET['category']) && is_numeric($_GET['category']) ) { | |
$catId = intval($_GET['category']); | |
?> | |
<script type="text/javascript"> | |
jQuery(function() { | |
var catId = <?php echo json_encode($catId); ?>; | |
jQuery('#in-category-' + catId).click(); | |
}); |
This file contains 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( | |
'taxonomy' => 'place', | |
'parent' => 0, | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => true, //can be 1, '1' too | |
'number' => false, //can be 0, '0', '' too | |
'offset' => '', | |
'fields' => 'all', |
This file contains 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
<script> | |
if ( window.history.replaceState ) { | |
window.history.replaceState( null, null, window.location.href ); | |
} | |
</script> |
This file contains 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
<div id="myElement"> | |
<h1>My Title</h1> | |
<p>Some text...</p> | |
</div> | |
<button onclick="downloadAsImage()">Download as Image</button> | |
<button onclick="downloadAsPDF()">Download as PDF</button> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.3.2/html2canvas.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.2/jspdf.min.js"></script> |
OlderNewer