Permalink
Browse files

CodeSniffer Wordpress Standard Changes #1 ( According to Netbeans Plu…

…gin Rules )
  • Loading branch information...
Chirag
Chirag committed Feb 5, 2014
1 parent 79f38b4 commit c661611e871409526bf9400100657a38214c9fbf
Showing with 2,979 additions and 2,848 deletions.
  1. +1 −1 404.php
  2. +1,275 −1,270 admin/lib/rtp-admin-functions.php
  3. +172 −163 admin/rtp-theme-options.php
  4. +121 −110 comments.php
  5. +34 −28 footer.php
  6. +6 −6 functions.php
  7. +31 −29 header.php
  8. +98 −90 image.php
  9. +27 −26 index.php
  10. +54 −51 lib/rtp-comments.php
  11. +425 −397 lib/rtp-default-functions.php
  12. +52 −53 lib/rtp-hooks.php
  13. +217 −192 lib/rtp-init.php
  14. +259 −247 lib/rtp-post-summaries.php
  15. +19 −17 lib/rtp-search.php
  16. +55 −46 lib/rtp-sidebars.php
  17. +69 −61 loop-common.php
  18. +47 −44 search.php
  19. +14 −14 sidebar.php
  20. +3 −3 template-full-width.php
View
@@ -8,7 +8,7 @@
*/
get_header();
- $rtp_content_grid_class = apply_filters( 'rtp_set_content_grid_class', 'large-8 columns' ); ?>
+ $rtp_content_grid_class = apply_filters( 'rtp_set_content_grid_class', 'large-8 columns' ); ?>
<section id="content" role="main" class="rtp-content-section rtp-singular rtp-404-content <?php echo esc_attr( $rtp_content_grid_class ); ?>">

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -6,10 +6,9 @@
*
* @since rtPanel 2.0
*/
-
// Includes PHP files located in 'admin/php/' folder
-foreach ( glob( get_template_directory() . "/admin/lib/*.php" ) as $lib_filename ) {
- require_once( $lib_filename );
+foreach ( glob( get_template_directory() . '/admin/lib/*.php' ) as $lib_filename ) {
+ require_once( $lib_filename );
}
/**
@@ -21,166 +20,176 @@
*/
class rtp_theme {
- var $theme_pages;
-
- /**
- * Constructor
- *
- * @return void
- *
- * @since rtPanel 2.0
- **/
- function rtp_theme() {
- $this->theme_pages = apply_filters( 'rtp_add_theme_pages', array(
- 'rtp_general' => array(
- 'menu_title' => __( 'General', 'rtPanel' ),
- 'menu_slug' => 'rtp_general'
- ),
- 'rtp_post_comments' => array(
- 'menu_title' => __( 'Post &amp; Comments', 'rtPanel' ),
- 'menu_slug' => 'rtp_post_comments'
- ) )
- );
-
- // Register callback for admin menu setup
- add_action( 'admin_menu', array( &$this, 'rtp_theme_option_page' ) );
- }
-
- /**
- * Extends the admin menu, to add rtPanel
- *
- * @since rtPanel 2.0
- **/
- function rtp_theme_option_page( ) {
- // Add options page, you can also add it to different sections or use your own one
- add_theme_page( 'rtPanel - ' . $this->theme_pages['rtp_general']['menu_title'], '<strong class="rtpanel">rtPanel</strong>', 'edit_theme_options', 'rtp_general', array( &$this, 'rtp_admin_options' ) );
- foreach( $this->theme_pages as $key => $theme_page ) {
- if ( is_array( $theme_page ) )
- add_theme_page( 'rtPanel - ' . $theme_page['menu_title'], '--- <em>' . $theme_page['menu_title'] . '</em>', 'edit_theme_options', $theme_page['menu_slug'], array( &$this, 'rtp_admin_options' ) );
- }
-
- $tab = isset( $_GET['page'] ) ? $_GET['page'] : "rtp_general";
-
- /* Register callback gets call prior the own page gets rendered */
- add_action( 'load-appearance_page_' . $tab, array( &$this, 'rtp_on_load_page' ) );
- add_action( 'admin_print_styles-appearance_page_' . $tab, array( &$this, 'rtp_admin_page_styles' ) );
- add_action( 'admin_print_scripts-appearance_page_' . $tab, array( &$this, 'rtp_admin_page_scripts' ) );
- }
-
- /**
- * Includes scripts for theme options page
- *
- * @since rtPanel 2.0
- **/
- function rtp_admin_page_scripts() {
- wp_enqueue_script( 'rtp-admin-scripts', RTP_TEMPLATE_URL . '/admin/js/rtp-admin.js' );
- wp_enqueue_script( 'rtp-twitter-share', ('http://platform.twitter.com/widgets.js'),'', '', true );
- wp_enqueue_script( 'thickbox' );
- }
-
- /**
- * Includes styles for theme options page
- *
- * @since rtPanel 2.0
- **/
- function rtp_admin_page_styles() {
- wp_enqueue_style( 'rtp-admin-styles', RTP_TEMPLATE_URL . '/admin/css/rtp-admin.css' );
- wp_enqueue_style( 'thickbox'); //thickbox for logo and favicon upload option
- wp_enqueue_style( 'rtp-icon-fonts-animation', RTP_ASSETS_URL . '/fontello/css/animation.css', '', NULL );
- wp_enqueue_style( 'rtp-icon-fonts', RTP_ASSETS_URL . '/fontello/css/rtpanel-fontello.css', '', NULL );
- }
-
- /**
- * rtPanel Tabs
- *
- * Dividing the page into Tabs ( General, Post & Comments )
- *
- * @since rtPanel 2.0
- **/
- function rtp_admin_options() {
- global $pagenow;
- $tabs = array();
-
- /* Separate the options page into two tabs - General , Post & Comments */
- foreach( $this->theme_pages as $key=>$theme_page ) {
- if ( is_array( $theme_page ) )
- $tabs[$theme_page['menu_slug']] = $theme_page['menu_title'];
- }
- $links = array();
-
- // Check to see which tab we are on
- $current = isset( $_GET['page'] ) ? $_GET['page'] : "rtp_general";
- foreach ( $tabs as $tab => $name ) {
- if ( $tab == $current ) {
- $links[] = "<a class='nav-tab nav-tab-active' href='?page=$tab'>$name</a>";
- } else {
- $links[] = "<a class='nav-tab' href='?page=$tab'>$name</a>";
- }
- } ?>
-
- <div class="metabox-fixed metabox-holder alignright">
- <?php rtp_default_admin_sidebar(); ?>
- </div>
-
- <div class="wrap rtpanel-admin">
- <?php screen_icon( 'rtpanel' ); ?>
- <h2 class="rtp-tab-wrapper"><?php foreach ( $links as $link ) echo $link; ?></h2><?php
- if ( $pagenow == 'themes.php' ) {
- foreach( $this->theme_pages as $key=>$theme_page ) {
- if ( is_array( $theme_page ) ) {
- switch ( $current ) {
- case $theme_page['menu_slug'] :
- if ( function_exists( $theme_page['menu_slug'].'_options_page' ) )
- call_user_func( $theme_page['menu_slug'].'_options_page', 'appearance_page_' . $current );
- break;
- }
- }
- }
- } ?>
- </div><!-- .wrap --><?php
- }
-
- /**
- * Applies WordPress metabox funtionality to rtPanel metaboxes
- *
- * @since rtPanel 2.0
- **/
- function rtp_on_load_page() {
- /* Javascripts loaded to allow drag/drop, expand/collapse and hide/show of boxes. */
- wp_enqueue_script( 'common' );
- wp_enqueue_script( 'wp-lists' );
- wp_enqueue_script( 'postbox' );
-
- // Check to see which tab we are on
- $tab = isset( $_GET['page'] ) ? $_GET['page'] : "rtp_general";
-
- switch ( $tab ) {
- case 'rtp_general' :
- // All metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
- add_meta_box( 'logo_options', __( 'Logo & Favicon Settings', 'rtPanel'), 'rtp_logo_option_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'google_search', __( 'Google Custom Search Integration', 'rtPanel'), 'rtp_google_search_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'sidebar_options', __( 'Sidebar Settings', 'rtPanel' ), 'rtp_sidebar_options_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'custom_styles_options', __( 'Custom Styles', 'rtPanel' ), 'rtp_custom_styles_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'plugin_support', __( 'Plugin Support', 'rtPanel'), 'rtp_plugin_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'backup_options', __( 'Backup / Restore Settings', 'rtPanel' ), 'rtp_backup_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- do_action( $tab .'_metaboxes' );
- break;
- case 'rtp_post_comments' :
- // All metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
- add_meta_box( 'post_summaries_options', __('Post Summary Settings', 'rtPanel'), 'rtp_post_summaries_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'post_thumbnail_options', __('Post Thumbnail Settings', 'rtPanel'), 'rtp_post_thumbnail_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'post_meta_options', __('Post Meta Settings', 'rtPanel'), 'rtp_post_meta_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'pagination_options', __('Pagination Settings', 'rtPanel'), 'rtp_pagination_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- add_meta_box( 'comment_form_options', __('Comment Settings', 'rtPanel'), 'rtp_comment_form_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- //add_meta_box( 'gravatar_options', __('Gravatar Settings', 'rtPanel'), 'rtp_gravatar_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
- do_action( $tab .'_metaboxes' );
- break;
- case $tab :
- do_action( $tab .'_metaboxes' );
- break;
- }
- }
+ var $theme_pages;
+
+ /**
+ * Constructor
+ *
+ * @return void
+ *
+ * @since rtPanel 2.0
+ * */
+ function rtp_theme() {
+ $this->theme_pages = apply_filters(
+ 'rtp_add_theme_pages',
+ array(
+ 'rtp_general' => array(
+ 'menu_title' => __( 'General', 'rtPanel' ),
+ 'menu_slug' => 'rtp_general',
+ ),
+ 'rtp_post_comments' => array(
+ 'menu_title' => __( 'Post &amp; Comments', 'rtPanel' ),
+ 'menu_slug' => 'rtp_post_comments',
+ )
+ )
+ );
+
+ // Register callback for admin menu setup
+ add_action( 'admin_menu', array( &$this, 'rtp_theme_option_page' ) );
+ }
+
+ /**
+ * Extends the admin menu, to add rtPanel
+ *
+ * @since rtPanel 2.0
+ * */
+ function rtp_theme_option_page() {
+ // Add options page, you can also add it to different sections or use your own one
+ add_theme_page( 'rtPanel - ' . $this->theme_pages[ 'rtp_general' ][ 'menu_title' ], '<strong class="rtpanel">rtPanel</strong>', 'edit_theme_options', 'rtp_general', array( &$this, 'rtp_admin_options' ) );
+ foreach ( $this->theme_pages as $key => $theme_page ) {
+ if ( is_array( $theme_page ) )
+ add_theme_page( 'rtPanel - ' . $theme_page[ 'menu_title' ], '--- <em>' . $theme_page[ 'menu_title' ] . '</em>', 'edit_theme_options', $theme_page[ 'menu_slug' ], array( &$this, 'rtp_admin_options' ) );
+ }
+
+ $tab = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : 'rtp_general';
+
+ /* Register callback gets call prior the own page gets rendered */
+ add_action( 'load-appearance_page_' . $tab, array( &$this, 'rtp_on_load_page' ) );
+ add_action( 'admin_print_styles-appearance_page_' . $tab, array( &$this, 'rtp_admin_page_styles' ) );
+ add_action( 'admin_print_scripts-appearance_page_' . $tab, array( &$this, 'rtp_admin_page_scripts' ) );
+ }
+
+ /**
+ * Includes scripts for theme options page
+ *
+ * @since rtPanel 2.0
+ * */
+ function rtp_admin_page_scripts() {
+ wp_enqueue_script( 'rtp-admin-scripts', RTP_TEMPLATE_URL . '/admin/js/rtp-admin.js' );
+ wp_enqueue_script( 'rtp-twitter-share', ('http://platform.twitter.com/widgets.js' ), '', '', true );
+ wp_enqueue_script( 'thickbox' );
+ }
+
+ /**
+ * Includes styles for theme options page
+ *
+ * @since rtPanel 2.0
+ * */
+ function rtp_admin_page_styles() {
+ wp_enqueue_style( 'rtp-admin-styles', RTP_TEMPLATE_URL . '/admin/css/rtp-admin.css' );
+ wp_enqueue_style( 'thickbox' ); //thickbox for logo and favicon upload option
+ wp_enqueue_style( 'rtp-icon-fonts-animation', RTP_ASSETS_URL . '/fontello/css/animation.css', '', NULL );
+ wp_enqueue_style( 'rtp-icon-fonts', RTP_ASSETS_URL . '/fontello/css/rtpanel-fontello.css', '', NULL );
+ }
+
+ /**
+ * rtPanel Tabs
+ *
+ * Dividing the page into Tabs ( General, Post & Comments )
+ *
+ * @since rtPanel 2.0
+ * */
+ function rtp_admin_options() {
+ global $pagenow;
+ $tabs = array();
+
+ /* Separate the options page into two tabs - General , Post & Comments */
+ foreach ( $this->theme_pages as $key => $theme_page ) {
+ if ( is_array( $theme_page ) )
+ $tabs[ $theme_page[ 'menu_slug' ] ] = $theme_page[ 'menu_title' ];
+ }
+ $links = array();
+
+ // Check to see which tab we are on
+ $current = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : 'rtp_general';
+ foreach ( $tabs as $tab => $name ) {
+ if ( $tab == $current ) {
+ $links[] = "<a class='nav-tab nav-tab-active' href='?page=$tab'>$name</a>";
+ } else {
+ $links[] = "<a class='nav-tab' href='?page=$tab'>$name</a>";
+ }
+ }
+ ?>
+
+ <div class="metabox-fixed metabox-holder alignright">
+ <?php rtp_default_admin_sidebar(); ?>
+ </div>
+
+ <div class="wrap rtpanel-admin">
+ <?php screen_icon( 'rtpanel' ); ?>
+ <h2 class="rtp-tab-wrapper">
+ <?php foreach ( $links as $link ){
+ echo $link;
+ } ?>
+ </h2><?php
+ if ( $pagenow == 'themes.php' ) {
+ foreach ( $this->theme_pages as $key => $theme_page ) {
+ if ( is_array( $theme_page ) ) {
+ switch ( $current ) {
+ case $theme_page['menu_slug'] :
+ if ( function_exists( $theme_page['menu_slug'] . '_options_page' ) )
+ call_user_func( $theme_page['menu_slug'] . '_options_page', 'appearance_page_' . $current );
+ break;
+ }
+ }
+ }
+ }
+ ?>
+ </div><!-- .wrap --><?php
+ }
+
+ /**
+ * Applies WordPress metabox funtionality to rtPanel metaboxes
+ *
+ * @since rtPanel 2.0
+ * */
+ function rtp_on_load_page() {
+ /* Javascripts loaded to allow drag/drop, expand/collapse and hide/show of boxes. */
+ wp_enqueue_script( 'common' );
+ wp_enqueue_script( 'wp-lists' );
+ wp_enqueue_script( 'postbox' );
+
+ // Check to see which tab we are on
+ $tab = isset( $_GET[ 'page' ] ) ? $_GET[ 'page' ] : 'rtp_general';
+
+ switch ( $tab ) {
+ case 'rtp_general' :
+ // All metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
+ add_meta_box( 'logo_options', __( 'Logo & Favicon Settings', 'rtPanel' ), 'rtp_logo_option_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'google_search', __( 'Google Custom Search Integration', 'rtPanel' ), 'rtp_google_search_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'sidebar_options', __( 'Sidebar Settings', 'rtPanel' ), 'rtp_sidebar_options_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'custom_styles_options', __( 'Custom Styles', 'rtPanel' ), 'rtp_custom_styles_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'plugin_support', __( 'Plugin Support', 'rtPanel' ), 'rtp_plugin_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'backup_options', __( 'Backup / Restore Settings', 'rtPanel' ), 'rtp_backup_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ do_action( $tab . '_metaboxes' );
+ break;
+ case 'rtp_post_comments' :
+ // All metaboxes registered during load page can be switched off/on at "Screen Options" automatically, nothing special to do therefore
+ add_meta_box( 'post_summaries_options', __( 'Post Summary Settings', 'rtPanel' ), 'rtp_post_summaries_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'post_thumbnail_options', __( 'Post Thumbnail Settings', 'rtPanel' ), 'rtp_post_thumbnail_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'post_meta_options', __( 'Post Meta Settings', 'rtPanel' ), 'rtp_post_meta_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'pagination_options', __( 'Pagination Settings', 'rtPanel' ), 'rtp_pagination_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ add_meta_box( 'comment_form_options', __( 'Comment Settings', 'rtPanel' ), 'rtp_comment_form_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ //add_meta_box( 'gravatar_options', __('Gravatar Settings', 'rtPanel'), 'rtp_gravatar_metabox', 'appearance_page_' . $tab, 'normal', 'core' );
+ do_action( $tab . '_metaboxes' );
+ break;
+ case $tab :
+ do_action( $tab . '_metaboxes' );
+ break;
+ }
+ }
+
}
// ★ of the show: rtPanel ... we ♥ it ;)
-$rt_panel_theme = new rtp_theme();
+$rt_panel_theme = new rtp_theme();
Oops, something went wrong.

0 comments on commit c661611

Please sign in to comment.