'Version' ) ); $this_asd_function_lib_version = $asd_asdfunctionlib_file_data['Version']; if ( ! isset( $asd_function_lib_version ) ) { $asd_function_lib_version = $this_asd_function_lib_version; } else { if ( $this_asd_function_lib_version > $asd_function_lib_version ) { $asd_function_lib_version = $this_asd_function_lib_version; } } if ( ! function_exists( 'asd_function_lib_widgets_enqueues' ) ) { /** ---------------------------------------------------------------------------- * Function asd_function_lib_widgets_enqueues() * Enqueues WordPress built-in jQuery, plugin-provided Bootstrap * plugin css page. * Hooks into wp_enqueue_scripts action * * @param int $page - passed by the admin_enqueue_scripts action. */ function asd_function_lib_widgets_enqueues( $page ) { global $this_asd_function_lib_version; if ( 'artisan-site-designs_page_asd_decorate_navbar_settings' === $page ) { wp_enqueue_style( 'asd-function-lib', plugin_dir_url( __FILE__ ) . 'css/asd-function-lib.css', array(), $this_asd_function_lib_version ); } } add_action( 'admin_enqueue_scripts', 'asd_function_lib_widgets_enqueues' ); } /** ---------------------------------------------------------------------------- * some prefab arrays that come in handy * ------------------------------------------------------------------------- */ if ( ! isset( $asd_truefalse_array ) ) { /** ---------------------------------------------------------------------------- * array to populate true/false options */ $asd_truefalse_array = array( 'true', 'false', ); } if ( ! isset( $asd_cpt_dashboard_display_options ) ) { /** ---------------------------------------------------------------------------- * array to populate where custom post types show in dashboard * --------------------------------------------------------------------------*/ $asd_cpt_dashboard_display_options = array( 'Both Menus', 'Main Dashboard Menu', 'ASD Submenu' ); } if ( ! function_exists( 'asd_media_library_selector_control' ) ) { /** ---------------------------------------------------------------------------- * Function asd_media_library_selector_control( $params_array ) * ---------------------------------------------------------------------------- * * @param array $params_array - array of options for the select. */ function asd_media_library_selector_control( $params_array ) { $settingname = $params_array['settingname']; $settingval = ''; $settingurl = ''; if ( $settingname ) { $settingval = get_option( $settingname ); } if ( $settingval ) { $settingurl = wp_get_attachment_url( $settingval ); } echo '
' . "\r\n"; echo '
' . "\r\n"; echo '
' . "\r\n"; echo '' . "\r\n"; echo ''; ?> "; echo "\r\n"; } } if ( ! function_exists( 'asd_fld_insert_narrow' ) ) { /** ---------------------------------------------------------------------------- * Function asd_fld_insert_narrow( $settingname ) * A shortcut function to create a narrower HTML input field based only on a * setting name * ---------------------------------------------------------------------------- * * @param string $settingname - the name of the setting. */ function asd_fld_insert_narrow( $settingname ) { echo '"; echo "\r\n"; } } if ( ! function_exists( 'asd_fld_insert_narrow6' ) ) { /** ---------------------------------------------------------------------------- * Function asd_fld_insert_narrow6( $settingname ) * A shortcut function to create a narrower HTML input field based only on a * setting name * ---------------------------------------------------------------------------- * * @param string $settingname - the name of the setting. */ function asd_fld_insert_narrow6( $settingname ) { echo '"; echo "\r\n"; } } if ( ! function_exists( 'short_content' ) ) { /** ---------------------------------------------------------------------------- * similar to an excerpt, the first 296 characters of content broken * between words at whitespace, with tags forced to balance * * @param string $text - the content to be excerpted. */ function short_content( $text ) { $length = 295; if ( strlen( $text ) < $length + 10 ) { return $text; } else { $break_pos = strpos( $text, ' ', $length ); $visible = substr( $text, 0, $break_pos ); return balanceTags( $visible, true ); } } }