Skip to content

Instantly share code, notes, and snippets.

@rayflores
Created July 15, 2014 21:51
Show Gist options
  • Save rayflores/253c894c958ec5d3fb5e to your computer and use it in GitHub Desktop.
Save rayflores/253c894c958ec5d3fb5e to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: Override Front Page Display Settings
* Plugin URI: www.floressquad.com
* Version: 1.0
* Author: Ray Flores
* Author URI: www.rayflores.com
* Description: set Reading Front Page Displays to default "your latest posts"
* Requires at least: 3.5
* Tested up to: 3.9
@TODO admin options for setting page number.
@param front-static-pages, get_page_by_id selections
*/
function get_user_status_please() {
if ( is_user_logged_in() ) {
update_option( 'show_on_front', 'posts' );
} else {
update_option( 'page_on_front', 74 ); // get_option('xxxxx');
update_option( 'show_on_front', 'page' );
}
}
add_action( 'init', 'get_user_status_please' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment