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 | |
| /** | |
| * Check if user is logged in and is post author | |
| * Setup functions for front end post editing | |
| * @author Mike Hemberger | |
| * @link http://thestizmedia.com/front-end-post-editing-with-acf-pro/ | |
| * @uses Advanced Custom Fields Pro | |
| * @uses Sidr | |
| */ |
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 ( document, $, undefined ) { | |
| 'use strict'; | |
| // Initiate side menu | |
| $( '#edit-toggle' ).sidr({ | |
| name: 'edit-post', | |
| side: 'left', | |
| renaming: false, | |
| // displace: false, | |
| onOpen: function() { |
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 | |
| /** | |
| * Template Name: Create Post | |
| * | |
| * @author Mike Hemberger | |
| * @link http://thestizmedia.com/front-end-posting-with-acf-pro/ | |
| * @uses Advanced Custom Fields Pro | |
| */ | |
| /** |
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
| /* actions fired when listing/adding/editing posts or pages */ | |
| /* admin_head-(hookname) */ | |
| add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
| add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
| add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
| function admin_head_post_editing() { | |
| echo 'you are editing a post'; | |
| } |
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 | |
| /** | |
| * Change size of comment avatars. | |
| */ | |
| add_filter( 'genesis_comment_list_args', 'childtheme_comment_list_args' ); | |
| function childtheme_comment_list_args( $args ) { | |
| $args['avatar_size'] = 90; | |
| return $args; | |
| } |
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_filter( 'manage_edit-resident_columns', 'set_custom_edit_resident_columns' ); | |
| add_action( 'manage_resident_posts_custom_column' , 'custom_resident_column', 10, 2 ); | |
| function set_custom_edit_resident_columns($columns) { | |
| $columns = array( | |
| 'cb' => '<input type="checkbox" />', | |
| 'title' => 'Title', | |
| 'display' => 'Display', |
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 toolbar from frontend and remove CSS that bumps content down | |
| add_filter( 'show_admin_bar', 'bhl_hide_admin_bar_from_front_end' ); | |
| function bhl_hide_admin_bar_from_front_end(){ | |
| if ( ! current_user_can('manage_options') ) { | |
| return false; | |
| // Remove CSS | |
| remove_action( 'wp_head', '_admin_bar_bump_cb' ); |
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 toolbar for non admins | |
| add_action('after_setup_theme', 'mwm_remove_admin_bar'); | |
| function mwm_remove_admin_bar() { | |
| if ( !current_user_can('administrator') && !is_admin() ) { | |
| show_admin_bar(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 | |
| // Stay logged in | |
| add_filter( 'auth_cookie_expiration', 'mwm_keep_me_logged_in_for_4_weeks' ); | |
| function mwm_keep_me_logged_in_for_4_weeks( $expirein ) { | |
| return 2419200; // 4 weeks in seconds | |
| } |
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 | |
| // Redirect wp-login.php to custom url | |
| add_action( 'login_form_login', 'mwm_redirect_login' ); | |
| function mwm_redirect_login() { | |
| wp_redirect( home_url() ); | |
| exit(); | |
| } | |
| // Redirect wp-login.php?action=register to custom url |