Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/herald/core/admin
File: helpers.php
$options = apply_filters( 'herald_modify_module_columns', $options ); //Allow child themes or plugins to modify
[500] Fix | Delete
return $options;
[501] Fix | Delete
[502] Fix | Delete
}
[503] Fix | Delete
endif;
[504] Fix | Delete
[505] Fix | Delete
/**
[506] Fix | Delete
* Get meta options
[507] Fix | Delete
*
[508] Fix | Delete
* @param array $default Enable defaults i.e. array('date', 'comments')
[509] Fix | Delete
* @return array List of available options
[510] Fix | Delete
* @since 1.0
[511] Fix | Delete
*/
[512] Fix | Delete
[513] Fix | Delete
if ( !function_exists( 'herald_get_meta_opts' ) ):
[514] Fix | Delete
function herald_get_meta_opts( $default = array() ) {
[515] Fix | Delete
[516] Fix | Delete
$options = array();
[517] Fix | Delete
[518] Fix | Delete
$options['date'] = esc_html__( 'Date', 'herald' );
[519] Fix | Delete
$options['modified_date'] = esc_html__( 'Modified date', 'herald' );
[520] Fix | Delete
$options['time'] = esc_html__( 'Time', 'herald' );
[521] Fix | Delete
$options['comments'] = esc_html__( 'Comments', 'herald' );
[522] Fix | Delete
$options['author'] = esc_html__( 'Author', 'herald' );
[523] Fix | Delete
$options['views'] = esc_html__( 'Views', 'herald' );
[524] Fix | Delete
$options['rtime'] = esc_html__( 'Reading time', 'herald' );
[525] Fix | Delete
[526] Fix | Delete
if ( herald_is_wp_review_active() ) {
[527] Fix | Delete
$options['reviews'] = esc_html__( 'Reviews', 'herald' );
[528] Fix | Delete
}
[529] Fix | Delete
[530] Fix | Delete
if ( !empty( $default ) ) {
[531] Fix | Delete
foreach ( $options as $key => $option ) {
[532] Fix | Delete
if ( in_array( $key, $default ) ) {
[533] Fix | Delete
$options[$key] = 1;
[534] Fix | Delete
} else {
[535] Fix | Delete
$options[$key] = 0;
[536] Fix | Delete
}
[537] Fix | Delete
}
[538] Fix | Delete
}
[539] Fix | Delete
[540] Fix | Delete
$options = apply_filters( 'herald_modify_meta_opts', $options ); //Allow child themes or plugins to modify
[541] Fix | Delete
return $options;
[542] Fix | Delete
}
[543] Fix | Delete
endif;
[544] Fix | Delete
[545] Fix | Delete
/**
[546] Fix | Delete
* Get image ratio options
[547] Fix | Delete
*
[548] Fix | Delete
* @param bool $original Wheter to include "original (not cropped)" ratio option
[549] Fix | Delete
* @return array List of available options
[550] Fix | Delete
* @since 1.0
[551] Fix | Delete
*/
[552] Fix | Delete
[553] Fix | Delete
if ( !function_exists( 'herald_get_image_ratio_opts' ) ):
[554] Fix | Delete
function herald_get_image_ratio_opts( $original = false ) {
[555] Fix | Delete
[556] Fix | Delete
$options = array();
[557] Fix | Delete
[558] Fix | Delete
if ( $original ) {
[559] Fix | Delete
$options['original'] = esc_html__( 'Original (ratio as uploaded - do not crop)', 'herald' );
[560] Fix | Delete
}
[561] Fix | Delete
[562] Fix | Delete
$options['16_9'] = esc_html__( '16:9', 'herald' );
[563] Fix | Delete
$options['3_2'] = esc_html__( '3:2', 'herald' );
[564] Fix | Delete
$options['4_3'] = esc_html__( '4:3', 'herald' );
[565] Fix | Delete
$options['1_1'] = esc_html__( '1:1 (square)', 'herald' );
[566] Fix | Delete
$options['custom'] = esc_html__( 'Your custom ratio', 'herald' );
[567] Fix | Delete
[568] Fix | Delete
$options = apply_filters( 'herald_modify_image_ratio_opts', $options ); //Allow child themes or plugins to modify
[569] Fix | Delete
return $options;
[570] Fix | Delete
}
[571] Fix | Delete
endif;
[572] Fix | Delete
[573] Fix | Delete
[574] Fix | Delete
/**
[575] Fix | Delete
* Get header elements
[576] Fix | Delete
*
[577] Fix | Delete
* Functions gets the list (array) of elements which can be placed in header
[578] Fix | Delete
*
[579] Fix | Delete
* @param string $type top|main|bottom|sticky
[580] Fix | Delete
* @return array List of available elements
[581] Fix | Delete
* @since 1.0
[582] Fix | Delete
*/
[583] Fix | Delete
[584] Fix | Delete
if ( !function_exists( 'herald_get_header_elements' ) ):
[585] Fix | Delete
function herald_get_header_elements( $type = 'top' , $position = 'left', $default = false ) {
[586] Fix | Delete
[587] Fix | Delete
$options = array(
[588] Fix | Delete
'logo' => array( 'title' => esc_html__( 'Logo/Title', 'herald' ), 'dep' => array( 'middle' => array( 'left' ), 'sticky' => array() ) ),
[589] Fix | Delete
'logo-mini' => array( 'title' => esc_html__( 'Mini logo', 'herald' ), 'dep' => array( 'bottom' => array(), 'sticky' => array( 'left' ) ) ),
[590] Fix | Delete
'main-menu' => array( 'title' => esc_html__( 'Main menu', 'herald' ), 'dep' => array( 'middle' => array(), 'bottom' => array( 'left' ), 'sticky' => array( 'right' ) ) ),
[591] Fix | Delete
'social-menu' => array( 'title' => esc_html__( 'Social menu (icons list)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array( 'right' ), 'sticky' => array() ) ),
[592] Fix | Delete
'social-menu-drop' => array( 'title' => esc_html__( 'Social menu (icon/dropdown)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[593] Fix | Delete
'ad' => array( 'title' => esc_html__( 'Ad', 'herald' ), 'dep' => array( 'middle' => array( 'right' ) ) ),
[594] Fix | Delete
'search' => array( 'title' => esc_html__( 'Search (form)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[595] Fix | Delete
'search-drop' => array( 'title' => esc_html__( 'Search (icon/dropdown)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array( 'left' ), 'sticky' => array() ) ),
[596] Fix | Delete
'secondary-menu-1' => array( 'title' => esc_html__( 'Secondary menu 1', 'herald' ), 'dep' => array( 'top' => array( 'left' ), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[597] Fix | Delete
'secondary-menu-2' => array( 'title' => esc_html__( 'Secondary menu 2', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[598] Fix | Delete
'secondary-menu-3' => array( 'title' => esc_html__( 'Secondary menu 3', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[599] Fix | Delete
'site-desc' => array( 'title' => esc_html__( 'Site desription', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[600] Fix | Delete
'date' => array( 'title' => esc_html__( 'Current date', 'herald' ), 'dep' => array( 'top' => array( 'right' ), 'bottom' => array() ) ),
[601] Fix | Delete
'login-form' => array( 'title' => esc_html__( 'Login form (icon/dropdown)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
[602] Fix | Delete
);
[603] Fix | Delete
[604] Fix | Delete
if ( herald_is_woocommerce_active() ) {
[605] Fix | Delete
$options['woocommerce-cart-icon'] = array( 'title' => esc_html__( 'WooCommerce Cart Icon', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) );
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
$options = apply_filters( 'herald_modify_header_elements', $options ); //Allow child themes or plugins to modify
[609] Fix | Delete
[610] Fix | Delete
foreach ( $options as $opt => $data ) {
[611] Fix | Delete
if ( array_key_exists( $type, $data['dep'] ) ) {
[612] Fix | Delete
if ( !$default ) {
[613] Fix | Delete
$output[$opt] = $data['title'];
[614] Fix | Delete
} else {
[615] Fix | Delete
if ( in_array( $position, $data['dep'][$type] ) ) {
[616] Fix | Delete
$output[$opt] = 1;
[617] Fix | Delete
} else {
[618] Fix | Delete
$output[$opt] = 0;
[619] Fix | Delete
}
[620] Fix | Delete
}
[621] Fix | Delete
}
[622] Fix | Delete
}
[623] Fix | Delete
[624] Fix | Delete
return $output;
[625] Fix | Delete
}
[626] Fix | Delete
endif;
[627] Fix | Delete
[628] Fix | Delete
/**
[629] Fix | Delete
* Get responsive action
[630] Fix | Delete
*
[631] Fix | Delete
* Functions gets the list (array) of elements which can be placed in responsive header
[632] Fix | Delete
*
[633] Fix | Delete
* @return array List of available elements
[634] Fix | Delete
* @since 2.1.4
[635] Fix | Delete
*/
[636] Fix | Delete
[637] Fix | Delete
if ( !function_exists( 'herald_get_header_responsive_actions' ) ):
[638] Fix | Delete
function herald_get_header_responsive_actions() {
[639] Fix | Delete
[640] Fix | Delete
$options = array(
[641] Fix | Delete
'search-drop' => esc_html__( 'Search (icon/dropdown)', 'herald' ),
[642] Fix | Delete
'login-form' => esc_html__( 'Login form (icon/dropdown)', 'herald' ),
[643] Fix | Delete
);
[644] Fix | Delete
[645] Fix | Delete
if ( herald_is_woocommerce_active() ) {
[646] Fix | Delete
$options['woocommerce-cart-icon'] = esc_html__( 'WooCommerce Cart Icon', 'herald' );
[647] Fix | Delete
}
[648] Fix | Delete
[649] Fix | Delete
$options = apply_filters( 'herald_modify_header_responsive_actions', $options ); //Allow child themes or plugins to modify
[650] Fix | Delete
[651] Fix | Delete
return $options;
[652] Fix | Delete
}
[653] Fix | Delete
endif;
[654] Fix | Delete
[655] Fix | Delete
/**
[656] Fix | Delete
* Get footer elements
[657] Fix | Delete
*
[658] Fix | Delete
* Functions gets the list (array) of elements which can be placed in footer copyright bar
[659] Fix | Delete
*
[660] Fix | Delete
* @param string $type top|main|bottom|sticky
[661] Fix | Delete
* @return array List of available elements
[662] Fix | Delete
* @since 1.0
[663] Fix | Delete
*/
[664] Fix | Delete
[665] Fix | Delete
if ( !function_exists( 'herald_get_footer_elements' ) ):
[666] Fix | Delete
function herald_get_footer_elements( $position = 'left', $default = false ) {
[667] Fix | Delete
[668] Fix | Delete
$options = array(
[669] Fix | Delete
'copyright' => array( 'title' => esc_html__( 'Copyright text', 'herald' ), 'dep' => array( 'left' ) ),
[670] Fix | Delete
'social-menu' => array( 'title' => esc_html__( 'Social menu', 'herald' ), 'dep' => array( 'right' ) ),
[671] Fix | Delete
'secondary-menu-1' => array( 'title' => esc_html__( 'Secondary menu 1', 'herald' ), 'dep' => array() ),
[672] Fix | Delete
'secondary-menu-2' => array( 'title' => esc_html__( 'Secondary menu 2', 'herald' ), 'dep' => array() ),
[673] Fix | Delete
'secondary-menu-3' => array( 'title' => esc_html__( 'Secondary menu 3', 'herald' ), 'dep' => array() ),
[674] Fix | Delete
'date' => array( 'title' => esc_html__( 'Current date', 'herald' ), 'dep' => array() ),
[675] Fix | Delete
);
[676] Fix | Delete
[677] Fix | Delete
$options = apply_filters( 'herald_modify_footer_elements', $options ); //Allow child themes or plugins to modify
[678] Fix | Delete
[679] Fix | Delete
foreach ( $options as $opt => $data ) {
[680] Fix | Delete
if ( !$default ) {
[681] Fix | Delete
$output[$opt] = $data['title'];
[682] Fix | Delete
} else {
[683] Fix | Delete
if ( in_array( $position, $data['dep'] ) ) {
[684] Fix | Delete
$output[$opt] = 1;
[685] Fix | Delete
} else {
[686] Fix | Delete
$output[$opt] = 0;
[687] Fix | Delete
}
[688] Fix | Delete
}
[689] Fix | Delete
}
[690] Fix | Delete
[691] Fix | Delete
return $output;
[692] Fix | Delete
}
[693] Fix | Delete
endif;
[694] Fix | Delete
[695] Fix | Delete
/**
[696] Fix | Delete
* Check if there is available theme update
[697] Fix | Delete
*
[698] Fix | Delete
* @return string HTML output with update notification and the link to change log
[699] Fix | Delete
* @since 1.0
[700] Fix | Delete
*/
[701] Fix | Delete
[702] Fix | Delete
if ( !function_exists( 'herald_get_update_notification' ) ):
[703] Fix | Delete
function herald_get_update_notification() {
[704] Fix | Delete
$current = get_site_transient( 'update_themes' );
[705] Fix | Delete
$message_html = '';
[706] Fix | Delete
if ( isset( $current->response['herald'] ) ) {
[707] Fix | Delete
$message_html = '<span class="update-message">New update available!</span>
[708] Fix | Delete
<span class="update-actions">Version '.$current->response['herald']['new_version'].': <a href="http://demo.mekshq.com/herald/documentation#changelog" target="blank">See what\'s new</a><a href="'.admin_url( 'update-core.php' ).'">Update</a></span>';
[709] Fix | Delete
} else {
[710] Fix | Delete
$message_html = '<a class="theme-version-label" href="https://mekshq.com/docs/herald-change-log" target="blank">Version '.HERALD_THEME_VERSION.'</a>';
[711] Fix | Delete
}
[712] Fix | Delete
[713] Fix | Delete
return $message_html;
[714] Fix | Delete
}
[715] Fix | Delete
endif;
[716] Fix | Delete
[717] Fix | Delete
/**
[718] Fix | Delete
* Sort option items
[719] Fix | Delete
*
[720] Fix | Delete
* Use this function to properly order sortable options like in categories and series module
[721] Fix | Delete
*
[722] Fix | Delete
* @param array $items Array of items
[723] Fix | Delete
* @param array $selected Array of IDs of currently selected items
[724] Fix | Delete
* @return array ordered items
[725] Fix | Delete
* @since 1.0
[726] Fix | Delete
*/
[727] Fix | Delete
[728] Fix | Delete
if ( !function_exists( 'herald_sort_option_items' ) ):
[729] Fix | Delete
function herald_sort_option_items( $items, $selected, $field = 'term_id' ) {
[730] Fix | Delete
[731] Fix | Delete
if ( empty( $selected ) ) {
[732] Fix | Delete
return $items;
[733] Fix | Delete
}
[734] Fix | Delete
[735] Fix | Delete
$new_items = array();
[736] Fix | Delete
$temp_items = array();
[737] Fix | Delete
$temp_items_ids = array();
[738] Fix | Delete
[739] Fix | Delete
foreach ( $selected as $selected_item_id ) {
[740] Fix | Delete
[741] Fix | Delete
foreach ( $items as $item ) {
[742] Fix | Delete
if ( $selected_item_id == $item->$field ) {
[743] Fix | Delete
$new_items[] = $item;
[744] Fix | Delete
} else {
[745] Fix | Delete
if ( !in_array( $item->$field, $selected ) && !in_array( $item->$field, $temp_items_ids ) ) {
[746] Fix | Delete
$temp_items[] = $item;
[747] Fix | Delete
$temp_items_ids[] = $item->$field;
[748] Fix | Delete
}
[749] Fix | Delete
}
[750] Fix | Delete
}
[751] Fix | Delete
[752] Fix | Delete
}
[753] Fix | Delete
[754] Fix | Delete
$new_items = array_merge( $new_items, $temp_items );
[755] Fix | Delete
[756] Fix | Delete
return $new_items;
[757] Fix | Delete
}
[758] Fix | Delete
endif;
[759] Fix | Delete
[760] Fix | Delete
[761] Fix | Delete
/**
[762] Fix | Delete
* Get Admin JS localized variables
[763] Fix | Delete
*
[764] Fix | Delete
* Function creates list of variables from theme to pass
[765] Fix | Delete
* them to global JS variable so we can use it in JS files
[766] Fix | Delete
*
[767] Fix | Delete
* @since 1.9
[768] Fix | Delete
*
[769] Fix | Delete
* @return array List of JS settings
[770] Fix | Delete
*/
[771] Fix | Delete
if ( !function_exists( 'herald_get_admin_js_settings' ) ):
[772] Fix | Delete
function herald_get_admin_js_settings() {
[773] Fix | Delete
[774] Fix | Delete
$js_settings = array();
[775] Fix | Delete
$js_settings['ajax_url'] = admin_url( 'admin-ajax.php' );
[776] Fix | Delete
$js_settings['is_gutenberg'] = herald_is_gutenberg_page();
[777] Fix | Delete
return $js_settings;
[778] Fix | Delete
}
[779] Fix | Delete
endif;
[780] Fix | Delete
[781] Fix | Delete
[782] Fix | Delete
/**
[783] Fix | Delete
* Get author social links
[784] Fix | Delete
*
[785] Fix | Delete
* @since 2.1
[786] Fix | Delete
*
[787] Fix | Delete
* @param array $default Enable defaults i.e. array('twitter')
[788] Fix | Delete
* @return array List of available options
[789] Fix | Delete
*/
[790] Fix | Delete
[791] Fix | Delete
if ( !function_exists( 'herald_get_author_social_opts' ) ):
[792] Fix | Delete
function herald_get_author_social_opts( $default = array() ) {
[793] Fix | Delete
[794] Fix | Delete
$options = array();
[795] Fix | Delete
[796] Fix | Delete
$options['twitter'] = esc_html__( 'Twitter', 'herald' );
[797] Fix | Delete
$options['facebook'] = esc_html__( 'Facebook', 'herald' );
[798] Fix | Delete
$options['instagram'] = esc_html__( 'Instagram', 'herald' );
[799] Fix | Delete
[800] Fix | Delete
[801] Fix | Delete
if ( !empty( $default ) ) {
[802] Fix | Delete
foreach ( $options as $key => $option ) {
[803] Fix | Delete
if ( in_array( $key, $default ) ) {
[804] Fix | Delete
$options[$key] = 1;
[805] Fix | Delete
} else {
[806] Fix | Delete
$options[$key] = 0;
[807] Fix | Delete
}
[808] Fix | Delete
}
[809] Fix | Delete
}
[810] Fix | Delete
[811] Fix | Delete
$options = apply_filters( 'herald_modify_author_social_opts', $options );
[812] Fix | Delete
return $options;
[813] Fix | Delete
}
[814] Fix | Delete
endif;
[815] Fix | Delete
[816] Fix | Delete
/**
[817] Fix | Delete
* Check if Envato Market plugin is active
[818] Fix | Delete
*
[819] Fix | Delete
* @return bool
[820] Fix | Delete
* @since 1.7.2
[821] Fix | Delete
*/
[822] Fix | Delete
if ( !function_exists( 'herald_is_envato_market_active' ) ):
[823] Fix | Delete
function herald_is_envato_market_active() {
[824] Fix | Delete
return function_exists('envato_market');
[825] Fix | Delete
}
[826] Fix | Delete
endif;
[827] Fix | Delete
[828] Fix | Delete
[829] Fix | Delete
/**
[830] Fix | Delete
* Check if Redux Options framework is active
[831] Fix | Delete
*
[832] Fix | Delete
* @return bool
[833] Fix | Delete
* @since 1.0
[834] Fix | Delete
*/
[835] Fix | Delete
if ( !function_exists( 'herald_is_redux_active' ) ):
[836] Fix | Delete
function herald_is_redux_active() {
[837] Fix | Delete
return class_exists( 'ReduxFramework' );
[838] Fix | Delete
}
[839] Fix | Delete
endif;
[840] Fix | Delete
[841] Fix | Delete
?>
[842] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function