From 07683cffb11837b7715996b83e9078fd609efb26 Mon Sep 17 00:00:00 2001 From: markAking Date: Mon, 13 Jun 2016 16:08:11 -0400 Subject: [PATCH 1/6] added new project status, this is just in admin now. Next commit will have it on the dashboard --- .../wp-content/themes/backer/functions.php | 254 ++++++++++-------- 1 file changed, 145 insertions(+), 109 deletions(-) diff --git a/wordpress/wp-content/themes/backer/functions.php b/wordpress/wp-content/themes/backer/functions.php index 8e2c2ad7..e724a9f4 100644 --- a/wordpress/wp-content/themes/backer/functions.php +++ b/wordpress/wp-content/themes/backer/functions.php @@ -1,4 +1,40 @@ _x( 'Needs Editing', 'post' ), + 'public' => true, + 'show_in_admin_all_list' => true, + 'show_in_admin_status_list' => true, + 'label_count' => _n_noop( 'Needs Editing (%s)', 'Needs Editing (%s)' ) + ) ); +} + +function append_project_status_list(){ + global $post; + $complete = ''; + $label = ''; + if($post->post_type == 'ignition_product'){ + if($post->post_status == 'needsediting'){ + $complete = ' selected=\'selected\''; + $label = ' Needs Editing'; + } + echo ' + + '; + } +} + /*--------------------------------- Setup OptionTree ------------------------------------*/ @@ -232,7 +268,7 @@ add_action( 'after_setup_theme', 'krown_setup' ); if ( ! function_exists( '_wp_render_title_tag' ) ) { function theme_slug_render_title() { - echo '' . wp_title( '|', false, 'right' ) . "\n"; + echo '' . wp_title( '|', false, 'right' ) . "\n"; } add_action( 'wp_head', 'theme_slug_render_title' ); @@ -432,7 +468,7 @@ if ( ! function_exists( 'krown_excerptlength_post' ) ) { // Length (words no) function krown_excerptlength_post() { - return 15; + return 15; } } @@ -442,7 +478,7 @@ if ( ! function_exists( 'krown_excerptlength_post_big' ) ) { // Length (words no) function krown_excerptlength_post_big() { - return 80; + return 80; } } @@ -452,7 +488,7 @@ if ( ! function_exists( 'krown_excerptmore' ) ) { // More text function krown_excerptmore() { - return ' ...'; + return ' ...'; } } @@ -467,37 +503,37 @@ if ( ! function_exists( 'krown_excerpt' ) ) { function krown_excerpt( $length_callback = '', $more_callback = 'krown_excerptmore' ) { - global $post; + global $post; - if ( function_exists( $length_callback ) ) { + if ( function_exists( $length_callback ) ) { add_filter( 'excerpt_length', $length_callback ); - } + } - if ( function_exists( $more_callback ) ){ + if ( function_exists( $more_callback ) ){ add_filter( 'excerpt_more', $more_callback ); - } + } - $output = get_the_excerpt(); + $output = get_the_excerpt(); - if ( empty( $output ) ) { + if ( empty( $output ) ) { - // If the excerpt is empty (on pages created 100% with shortcodes), we should take the content, strip shortcodes, remove all HTML tags, then return the correct number of words + // If the excerpt is empty (on pages created 100% with shortcodes), we should take the content, strip shortcodes, remove all HTML tags, then return the correct number of words - $output = strip_tags( preg_replace( "~(?:\[/?)[^\]]+/?\]~s", '', $post->post_content ) ); - $output = explode( ' ', $output, $length_callback() ); - array_pop( $output ); - $output = implode( ' ', $output ) . $more_callback(); + $output = strip_tags( preg_replace( "~(?:\[/?)[^\]]+/?\]~s", '', $post->post_content ) ); + $output = explode( ' ', $output, $length_callback() ); + array_pop( $output ); + $output = implode( ' ', $output ) . $more_callback(); - } else { + } else { - // Continue with the regular excerpt method + // Continue with the regular excerpt method - $output = apply_filters( 'wptexturize', $output ); - $output = apply_filters( 'convert_chars', $output ); + $output = apply_filters( 'wptexturize', $output ); + $output = apply_filters( 'convert_chars', $output ); - } + } - return $output; + return $output; } @@ -535,13 +571,13 @@ if ( ! function_exists( 'krown_search_form' ) ) { function krown_search_form( $form ) { - $form = ' + $form = ' '; - return $form; + '; + return $form; } @@ -772,9 +808,9 @@ if ( ! function_exists( 'krown_custom_header' ) ) { ------------------------------------*/ function krown_custom_login_logo() { - echo ''; + echo ''; } add_action( 'login_head', 'krown_custom_login_logo' ); @@ -863,11 +899,11 @@ function krown_sidebar_class() { function krown_request_filter( $query_vars ) { - if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { - $query_vars['s'] = " "; - } + if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) { + $query_vars['s'] = " "; + } - return $query_vars; + return $query_vars; } add_filter('request', 'krown_request_filter'); @@ -1006,21 +1042,21 @@ if ( ! function_exists( 'krown_mce_custom_styles' ) ) { function krown_mce_custom_styles($settings) { - $settings['theme_advanced_blockformats'] = 'p,h1,h2,h3,h4'; + $settings['theme_advanced_blockformats'] = 'p,h1,h2,h3,h4'; - $style_formats = array( - array('title' => 'Extreme', 'inline' => 'span', 'classes' => 'extreme'), - array('title' => 'Large', 'inline' => 'span', 'classes' => 'large'), - array('title' => 'Medium', 'inline' => 'span', 'classes' => 'medium'), - array('title' => 'Regular', 'inline' => 'span', 'classes' => 'regular'), - array('title' => 'Small', 'inline' => 'span', 'classes' => 'small'), - array('title' => 'Cite', 'inline' => 'cite', 'classes' => '') - ); + $style_formats = array( + array('title' => 'Extreme', 'inline' => 'span', 'classes' => 'extreme'), + array('title' => 'Large', 'inline' => 'span', 'classes' => 'large'), + array('title' => 'Medium', 'inline' => 'span', 'classes' => 'medium'), + array('title' => 'Regular', 'inline' => 'span', 'classes' => 'regular'), + array('title' => 'Small', 'inline' => 'span', 'classes' => 'small'), + array('title' => 'Cite', 'inline' => 'cite', 'classes' => '') + ); - $settings['style_formats'] = json_encode( $style_formats ); + $settings['style_formats'] = json_encode( $style_formats ); - return $settings; - + return $settings; + } } @@ -1047,7 +1083,7 @@ if ( ! function_exists( 'krown_mce_buttons' ) ) { function krown_mce_buttons( $buttons ) { array_unshift( $buttons, 'fontsizeselect' ); - array_unshift( $buttons, 'styleselect'); + array_unshift( $buttons, 'styleselect'); return $buttons; } @@ -1056,7 +1092,7 @@ if ( ! function_exists( 'krown_mce_buttons' ) ) { add_filter( 'mce_buttons_2', 'krown_mce_buttons' ); /*--------------------------------- - Update Notice + Update Notice ------------------------------------*/ add_action( 'admin_notices', 'krown_update_notice' ); @@ -1065,12 +1101,12 @@ function krown_update_notice() { if ( get_option( 'krown_koncept_version' ) != '1.1' ) { - echo '
-

You have just updated to version 1.1 - Read the CHANGELOG

'; + echo '
+

You have just updated to version 1.1 - Read the CHANGELOG

'; - printf(__('Dismiss'), '?krown_update_done_do=1'); + printf(__('Dismiss'), '?krown_update_done_do=1'); - echo "

"; + echo "

"; } @@ -1079,99 +1115,99 @@ add_action( 'admin_init', 'krown_update_done_do' ); function krown_update_done_do() { global $current_user; - $user_id = $current_user->ID; - if ( isset( $_GET['krown_update_done_do'] ) && '1' == $_GET['krown_update_done_do'] ) { - update_option( 'krown_koncept_version', '1.1' ); + $user_id = $current_user->ID; + if ( isset( $_GET['krown_update_done_do'] ) && '1' == $_GET['krown_update_done_do'] ) { + update_option( 'krown_koncept_version', '1.1' ); } } /*--------------------------------- - Navigation Walker + Navigation Walker ------------------------------------*/ class Krown_Nav_Walker extends Walker_Nav_Menu { - function start_lvl( &$output, $depth=0, $args=array() ) { - if ( $depth == 0 ) { - $output .= '