diff --git a/.gitignore b/.gitignore index 31b6c63..1cc4572 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -.idea .idea/workspace.xml diff --git a/class/class-mainwp-pages.php b/class/class-mainwp-pages.php index 5379286..e994344 100644 --- a/class/class-mainwp-pages.php +++ b/class/class-mainwp-pages.php @@ -1,31 +1,64 @@ get_branding_options(); @@ -67,7 +110,12 @@ class MainWP_Pages { MainWP_Child_Server_Information_Render::render_warnings(); } - public function admin_menu() { + /** + * Admin menu settings. + * + * Add and remove Admin Menu Items dependant upon Branding settings. + */ + public function admin_menu() { $branding_opts = MainWP_Child_Branding::instance()->get_branding_options(); $is_hide = isset( $branding_opts['hide'] ) ? $branding_opts['hide'] : ''; $cancelled_branding = $branding_opts['cancelled_branding']; @@ -119,7 +167,12 @@ class MainWP_Pages { } } - private function init_pages( $child_menu_title ) { + /** + * Initiate MainWP Child Plugin pages. + * + * @param $child_menu_title New MainWP Child Plugin title defined in branding settings. + */ + private function init_pages($child_menu_title ) { $settingsPage = add_submenu_page( 'options-general.php', $child_menu_title, $child_menu_title, 'manage_options', 'mainwp_child_tab', array( &$this, 'render_pages' ) ); @@ -178,7 +231,14 @@ class MainWP_Pages { } } - public function plugin_row_meta( $plugin_meta, $plugin_file ) { + /** + * MainWP Child Plugin meta data. + * + * @param $plugin_meta Plugin meta. + * @param $plugin_file Plugin file. + * @return mixed The filtered value after all hooked functions are applied to it. + */ + public function plugin_row_meta($plugin_meta, $plugin_file ) { global $mainWPChild; if ( $mainWPChild->plugin_slug !== $plugin_file ) { return $plugin_meta; @@ -186,7 +246,13 @@ class MainWP_Pages { return apply_filters( 'mainwp_child_plugin_row_meta', $plugin_meta, $plugin_file, $mainWPChild->plugin_slug ); } - public function render_pages( $shownPage ) { + /** + * Render MainWP Child Plugin pages. + * + * @param $shownPage Page that has been shown. + * @return string Page html. + */ + public function render_pages($shownPage ) { $shownPage = ''; if ( isset( $_GET['tab'] ) ) { $shownPage = $_GET['tab']; @@ -258,7 +324,14 @@ class MainWP_Pages { self::render_footer(); } - public static function render_header( $shownPage, $subpage = true ) { + /** + * Render page header. + * + * @param $shownPage Page shown. + * @param bool $subpage Whether or not a subpage. Default: true. + * @return string Header html. + */ + public static function render_header($shownPage, $subpage = true ) { if ( isset( $_GET['tab'] ) ) { $shownPage = $_GET['tab']; } @@ -413,15 +486,22 @@ class MainWP_Pages {