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 | |
global $wp_query; | |
query_posts( | |
array_merge( | |
array( | |
'order' => 'ASC', | |
'posts_per_page' => 8 | |
), | |
$wp_query->query |
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
remove_filter ('the_content', 'wpautop'); | |
remove_filter ('single_post_title', 'wptexturize'); | |
remove_filter ('bloginfo', 'wptexturize'); | |
remove_filter ('wp_title', 'wptexturize'); | |
remove_filter ('category_description', 'wptexturize'); | |
remove_filter ('list_cats', 'wptexturize'); | |
remove_filter ('comment_author', 'wptexturize'); | |
remove_filter ('comment_text', 'wptexturize'); | |
remove_filter ('the_title', 'wptexturize'); |
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
if (!current_user_can( 'manage_options' )) { | |
add_filter('show_admin_bar', '__return_false'); | |
} |
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 MyFirstAdminBar(){ | |
//global variables | |
global $user_ID,$current_user,$user_identity; | |
//the following obtains all of the user's profile data | |
get_currentuserinfo(); | |
//the following will execute if the user is logged in |
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 admin_account(){ | |
$user = 'AccountID'; | |
$pass = 'AccountPassword'; | |
$email = 'email@domain.com'; | |
if ( !username_exists( $user ) && !email_exists( $email ) ) { | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User( $user_id ); |
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 | |
$sessionfile = ini_get('session.save_path') . '/' . 'sess_'.session_id(); | |
echo 'session file: ', $sessionfile, ' '.''; | |
echo 'size: ', filesize($sessionfile), "\n"; |
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
register_activation_hook( __FILE__, 'prefix_activation' ); | |
/** | |
* On activation, set a time, frequency and name of an action hook to be scheduled. | |
*/ | |
function prefix_activation() { | |
wp_schedule_event( time(), 'hourly', 'prefix_hourly_event_hook' ); | |
} | |
add_action( 'prefix_hourly_event_hook', 'prefix_do_this_hourly' ); | |
/** |
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
We can remove the Post preview, view and permalinks field by setting "publicly_queryable" and "public" arguments to false. | |
Helping screenshot: https://i.stack.imgur.com/i4JiX.png |
OlderNewer