', '' ); ?>

$nr_actions_required, 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'template_directory' => get_template_directory_uri(), 'no_required_actions_text' => __( 'Hooray! There are no required actions for you right now.','shapely' ) ) ); } } /** * Load scripts for customizer page * @since 1.8.2.4 */ public function shapely_welcome_scripts_for_customizer() { wp_enqueue_style( 'shapely-welcome-screen-customizer-css', get_template_directory_uri() . '/inc/admin/welcome-screen/css/welcome_customizer.css' ); wp_enqueue_script( 'shapely-welcome-screen-customizer-js', get_template_directory_uri() . '/inc/admin/welcome-screen/js/welcome_customizer.js', array('jquery'), '20120206', true ); global $shapely_required_actions; $nr_actions_required = 0; /* get number of required actions */ if( get_option('shapely_show_required_actions') ): $shapely_show_required_actions = get_option('shapely_show_required_actions'); else: $shapely_show_required_actions = array(); endif; if( !empty($shapely_required_actions) ): foreach( $shapely_required_actions as $shapely_required_action_value ): if(( !isset( $shapely_required_action_value['check'] ) || ( isset( $shapely_required_action_value['check'] ) && ( $shapely_required_action_value['check'] == false ) ) ) && ((isset($shapely_show_required_actions[$shapely_required_action_value['id']]) && ($shapely_show_required_actions[$shapely_required_action_value['id']] == true)) || !isset($shapely_show_required_actions[$shapely_required_action_value['id']]) )) : $nr_actions_required++; endif; endforeach; endif; wp_localize_script( 'shapely-welcome-screen-customizer-js', 'shapelyLiteWelcomeScreenCustomizerObject', array( 'nr_actions_required' => $nr_actions_required, 'aboutpage' => esc_url( admin_url( 'themes.php?page=shapely-welcome#actions_required' ) ), 'customizerpage' => esc_url( admin_url( 'customize.php#actions_required' ) ), 'themeinfo' => __('View Theme Info','shapely'), ) ); } /** * Dismiss required actions * @since 1.8.2.4 */ public function shapely_dismiss_required_action_callback() { global $shapely_required_actions; $shapely_dismiss_id = (isset($_GET['dismiss_id'])) ? $_GET['dismiss_id'] : 0; echo $shapely_dismiss_id; /* this is needed and it's the id of the dismissable required action */ if( !empty($shapely_dismiss_id) ): /* if the option exists, update the record for the specified id */ if( get_option('shapely_show_required_actions') ): $shapely_show_required_actions = get_option('shapely_show_required_actions'); $shapely_show_required_actions[$shapely_dismiss_id] = false; update_option( 'shapely_show_required_actions',$shapely_show_required_actions ); /* create the new option,with false for the specified id */ else: $shapely_show_required_actions_new = array(); if( !empty($shapely_required_actions) ): foreach( $shapely_required_actions as $shapely_required_action ): if( $shapely_required_action['id'] == $shapely_dismiss_id ): $shapely_show_required_actions_new[$shapely_required_action['id']] = false; else: $shapely_show_required_actions_new[$shapely_required_action['id']] = true; endif; endforeach; update_option( 'shapely_show_required_actions', $shapely_show_required_actions_new ); endif; endif; endif; die(); // this is required to return a proper result } /** * Welcome screen content * @since 1.8.2.4 */ public function shapely_welcome_screen() { ?>