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
/home/sportsfe.../httpdocs/clone/wp-conte.../themes/herald/core/admin
File: helpers.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Get the list of available options for post ordering
[3] Fix | Delete
*
[4] Fix | Delete
* @return array List of available options
[5] Fix | Delete
* @since 1.0
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
if ( !function_exists( 'herald_get_post_order_opts' ) ) :
[9] Fix | Delete
function herald_get_post_order_opts() {
[10] Fix | Delete
[11] Fix | Delete
$options = array(
[12] Fix | Delete
'date' => esc_html__( 'Date', 'herald' ),
[13] Fix | Delete
'modified' => esc_html__( 'Modified date', 'herald' ),
[14] Fix | Delete
'comment_count' => esc_html__( 'Number of comments', 'herald' ),
[15] Fix | Delete
'views' => esc_html__( 'Number of views', 'herald' ),
[16] Fix | Delete
'title' => esc_html__( 'Title (alphabetically)', 'herald' ),
[17] Fix | Delete
'rand' => esc_html__( 'Random', 'herald' ),
[18] Fix | Delete
);
[19] Fix | Delete
[20] Fix | Delete
if ( herald_is_wp_review_active() ) {
[21] Fix | Delete
$options['reviews_star'] = esc_html__( 'Author reviews (stars)', 'herald' );
[22] Fix | Delete
$options['reviews_point'] = esc_html__( 'Author reviews (points)', 'herald' );
[23] Fix | Delete
$options['reviews_percentage'] = esc_html__( 'Author reviews (percentage)', 'herald' );
[24] Fix | Delete
$options['user_reviews_star'] = esc_html__( 'User reviews (stars)', 'herald' );
[25] Fix | Delete
$options['user_reviews_point'] = esc_html__( 'User reviews (points)', 'herald' );
[26] Fix | Delete
$options['user_reviews_percentage'] = esc_html__( 'User reviews (percentage)', 'herald' );
[27] Fix | Delete
}
[28] Fix | Delete
[29] Fix | Delete
$options = apply_filters( 'herald_modify_post_order_opts', $options ); //Allow child themes or plugins to modify
[30] Fix | Delete
return $options;
[31] Fix | Delete
}
[32] Fix | Delete
endif;
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* Get the list of available options for products (WooCommerce) ordering
[36] Fix | Delete
*
[37] Fix | Delete
* @return array List of available options
[38] Fix | Delete
* @since 1.2
[39] Fix | Delete
*/
[40] Fix | Delete
[41] Fix | Delete
if ( !function_exists( 'herald_get_product_order_opts' ) ) :
[42] Fix | Delete
function herald_get_product_order_opts() {
[43] Fix | Delete
[44] Fix | Delete
$options = array(
[45] Fix | Delete
'date' => esc_html__( 'Date', 'herald' ),
[46] Fix | Delete
'modified' => esc_html__( 'Modified date', 'herald' ),
[47] Fix | Delete
'comment_count' => esc_html__( 'Number of comments', 'herald' ),
[48] Fix | Delete
'rand' => esc_html__( 'Random', 'herald' ),
[49] Fix | Delete
);
[50] Fix | Delete
[51] Fix | Delete
$options = apply_filters( 'herald_modify_product_order_opts', $options ); //Allow child themes or plugins to modify
[52] Fix | Delete
return $options;
[53] Fix | Delete
}
[54] Fix | Delete
endif;
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Get the list of available options for post ordering
[58] Fix | Delete
*
[59] Fix | Delete
* @return array List of available options
[60] Fix | Delete
* @since 1.0
[61] Fix | Delete
*/
[62] Fix | Delete
[63] Fix | Delete
if ( !function_exists( 'herald_get_fa_post_opts' ) ) :
[64] Fix | Delete
function herald_get_fa_post_opts( $args = false ) {
[65] Fix | Delete
[66] Fix | Delete
$options = array(
[67] Fix | Delete
'date' => esc_html__( 'Latest posts', 'herald' ),
[68] Fix | Delete
'modified' => esc_html__( 'Recently modified (updated) posts', 'herald' ),
[69] Fix | Delete
'comment_count' => esc_html__( 'Most commented posts', 'herald' ),
[70] Fix | Delete
'views' => esc_html__( 'Most viewed posts', 'herald' ),
[71] Fix | Delete
);
[72] Fix | Delete
[73] Fix | Delete
if ( herald_is_wp_review_active() ) {
[74] Fix | Delete
$options['reviews_star'] = esc_html__( 'Author reviews (stars)', 'herald' );
[75] Fix | Delete
$options['reviews_point'] = esc_html__( 'Author reviews (points)', 'herald' );
[76] Fix | Delete
$options['reviews_percentage'] = esc_html__( 'Author reviews (percentage)', 'herald' );
[77] Fix | Delete
[78] Fix | Delete
$options['user_reviews_star'] = esc_html__( 'User reviews (stars)', 'herald' );
[79] Fix | Delete
$options['user_reviews_point'] = esc_html__( 'User reviews (points)', 'herald' );
[80] Fix | Delete
$options['user_reviews_percentage'] = esc_html__( 'User reviews (percentage)', 'herald' );
[81] Fix | Delete
}
[82] Fix | Delete
[83] Fix | Delete
$options = apply_filters( 'herald_modify_fa_post_opts', $options ); //Allow child themes or plugins to modify
[84] Fix | Delete
return $options;
[85] Fix | Delete
}
[86] Fix | Delete
endif;
[87] Fix | Delete
[88] Fix | Delete
/**
[89] Fix | Delete
* Get the list of time limit options
[90] Fix | Delete
*
[91] Fix | Delete
* @return array List of available options
[92] Fix | Delete
* @since 1.0
[93] Fix | Delete
*/
[94] Fix | Delete
[95] Fix | Delete
if ( !function_exists( 'herald_get_time_diff_opts' ) ) :
[96] Fix | Delete
function herald_get_time_diff_opts() {
[97] Fix | Delete
[98] Fix | Delete
$options = array(
[99] Fix | Delete
'-1 day' => esc_html__( '1 Day', 'herald' ),
[100] Fix | Delete
'-3 days' => esc_html__( '3 Days', 'herald' ),
[101] Fix | Delete
'-1 week' => esc_html__( '1 Week', 'herald' ),
[102] Fix | Delete
'-1 month' => esc_html__( '1 Month', 'herald' ),
[103] Fix | Delete
'-3 months' => esc_html__( '3 Months', 'herald' ),
[104] Fix | Delete
'-6 months' => esc_html__( '6 Months', 'herald' ),
[105] Fix | Delete
'-1 year' => esc_html__( '1 Year', 'herald' ),
[106] Fix | Delete
'0' => esc_html__( 'All time', 'herald' )
[107] Fix | Delete
);
[108] Fix | Delete
[109] Fix | Delete
return $options;
[110] Fix | Delete
}
[111] Fix | Delete
endif;
[112] Fix | Delete
[113] Fix | Delete
[114] Fix | Delete
/**
[115] Fix | Delete
* Get the list of available options to filter posts by format
[116] Fix | Delete
*
[117] Fix | Delete
* @return array List of available post formats
[118] Fix | Delete
* @since 1.3
[119] Fix | Delete
*/
[120] Fix | Delete
[121] Fix | Delete
if ( !function_exists( 'herald_get_post_format_opts' ) ) :
[122] Fix | Delete
function herald_get_post_format_opts() {
[123] Fix | Delete
[124] Fix | Delete
$options = array();
[125] Fix | Delete
$options['standard'] = esc_html__( 'Standard', 'herald' );
[126] Fix | Delete
[127] Fix | Delete
$formats = get_theme_support( 'post-formats' );
[128] Fix | Delete
if ( !empty( $formats ) && is_array( $formats[0] ) ) {
[129] Fix | Delete
foreach ( $formats[0] as $format ) {
[130] Fix | Delete
$options[$format] = ucfirst( $format );
[131] Fix | Delete
}
[132] Fix | Delete
}
[133] Fix | Delete
[134] Fix | Delete
$options['0'] = esc_html__( 'All', 'herald' );
[135] Fix | Delete
[136] Fix | Delete
$options = apply_filters( 'herald_modify_post_format_opts', $options ); //Allow child themes or plugins to modify
[137] Fix | Delete
return $options;
[138] Fix | Delete
}
[139] Fix | Delete
endif;
[140] Fix | Delete
[141] Fix | Delete
[142] Fix | Delete
/**
[143] Fix | Delete
* Get the list of available post layouts
[144] Fix | Delete
*
[145] Fix | Delete
* @param bool $ihnerit Whether you want to add "inherit" option
[146] Fix | Delete
* @param bool $none Whether you want to add "none" option ( to set layout to "off")
[147] Fix | Delete
* @param array $exclude Array to optionally exclude some of layouts
[148] Fix | Delete
* @return array List of available options
[149] Fix | Delete
* @since 1.0
[150] Fix | Delete
*/
[151] Fix | Delete
[152] Fix | Delete
if ( !function_exists( 'herald_get_main_layouts' ) ):
[153] Fix | Delete
function herald_get_main_layouts( $inherit = false, $none = false, $exclude = array() ) {
[154] Fix | Delete
[155] Fix | Delete
if ( $inherit ) {
[156] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ), 'col' => 0 );
[157] Fix | Delete
}
[158] Fix | Delete
[159] Fix | Delete
if ( $none ) {
[160] Fix | Delete
$layouts['none'] = array( 'title' => esc_html__( 'None', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/none.png' ), 'col' => 0 );
[161] Fix | Delete
}
[162] Fix | Delete
[163] Fix | Delete
$layouts['a'] = array( 'title' => esc_html__( 'Layout A', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_a.png' ), 'col' => 12 );
[164] Fix | Delete
$layouts['a1'] = array( 'title' => esc_html__( 'Layout A1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_a1.png' ), 'col' => 12 );
[165] Fix | Delete
$layouts['a2'] = array( 'title' => esc_html__( 'Layout A2', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_a2.png' ), 'col' => 12 );
[166] Fix | Delete
$layouts['a3'] = array( 'title' => esc_html__( 'Layout A3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_a3.png' ), 'col' => 12 );
[167] Fix | Delete
$layouts['b'] = array( 'title' => esc_html__( 'Layout B', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_b.png' ), 'col' => 12 );
[168] Fix | Delete
$layouts['b1'] = array( 'title' => esc_html__( 'Layout B1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_b1.png' ), 'col' => 12 );
[169] Fix | Delete
$layouts['c'] = array( 'title' => esc_html__( 'Layout C', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_c.png' ), 'col' => 6 );
[170] Fix | Delete
$layouts['c1'] = array( 'title' => esc_html__( 'Layout C1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_c1.png' ), 'col' => 6 );
[171] Fix | Delete
$layouts['d'] = array( 'title' => esc_html__( 'Layout D', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_d.png' ), 'col' => 6 );
[172] Fix | Delete
$layouts['d1'] = array( 'title' => esc_html__( 'Layout D1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_d1.png' ), 'col' => 6 );
[173] Fix | Delete
$layouts['e'] = array( 'title' => esc_html__( 'Layout E', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_e.png' ), 'col' => 6 );
[174] Fix | Delete
$layouts['f'] = array( 'title' => esc_html__( 'Layout F', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_f.png' ), 'col' => 4 );
[175] Fix | Delete
$layouts['f1'] = array( 'title' => esc_html__( 'Layout F1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_f1.png' ), 'col' => 4 );
[176] Fix | Delete
$layouts['g'] = array( 'title' => esc_html__( 'Layout G', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_g.png' ), 'col' => 4 );
[177] Fix | Delete
$layouts['g1'] = array( 'title' => esc_html__( 'Layout G1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_g1.png' ), 'col' => 4 );
[178] Fix | Delete
$layouts['h'] = array( 'title' => esc_html__( 'Layout H', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_h.png' ), 'col' => 4 );
[179] Fix | Delete
$layouts['i'] = array( 'title' => esc_html__( 'Layout I', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_i.png' ), 'col' => 3 );
[180] Fix | Delete
$layouts['i1'] = array( 'title' => esc_html__( 'Layout I1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_i1.png' ), 'col' => 3 );
[181] Fix | Delete
$layouts['j'] = array( 'title' => esc_html__( 'Layout J', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_j.png' ), 'col' => 3 );
[182] Fix | Delete
$layouts['k'] = array( 'title' => esc_html__( 'Layout K', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_k.png' ), 'col' => 2 );
[183] Fix | Delete
$layouts['l'] = array( 'title' => esc_html__( 'Layout L', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_l.png' ), 'col' => 2 );
[184] Fix | Delete
[185] Fix | Delete
if ( !empty( $exclude ) ) {
[186] Fix | Delete
[187] Fix | Delete
foreach ( $exclude as $layout ) {
[188] Fix | Delete
if ( array_key_exists( $layout, $layouts ) ) {
[189] Fix | Delete
unset( $layouts[$layout] );
[190] Fix | Delete
}
[191] Fix | Delete
}
[192] Fix | Delete
}
[193] Fix | Delete
[194] Fix | Delete
$layouts = apply_filters( 'herald_modify_main_layouts', $layouts ); //Allow child themes or plugins to modify
[195] Fix | Delete
return $layouts;
[196] Fix | Delete
[197] Fix | Delete
}
[198] Fix | Delete
endif;
[199] Fix | Delete
[200] Fix | Delete
/**
[201] Fix | Delete
* Get the list of available featured layouts
[202] Fix | Delete
*
[203] Fix | Delete
* @param bool $ihnerit Whether you want to add "inherit" option
[204] Fix | Delete
* @param bool $none Whether you want to add "none" option ( to set layout to "off")
[205] Fix | Delete
* @return array List of available options
[206] Fix | Delete
* @since 1.0
[207] Fix | Delete
*/
[208] Fix | Delete
[209] Fix | Delete
if ( !function_exists( 'herald_get_featured_layouts' ) ):
[210] Fix | Delete
function herald_get_featured_layouts( $inherit = false, $none = false ) {
[211] Fix | Delete
[212] Fix | Delete
if ( $inherit ) {
[213] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ) );
[214] Fix | Delete
}
[215] Fix | Delete
[216] Fix | Delete
if ( $none ) {
[217] Fix | Delete
$layouts['none'] = array( 'title' => esc_html__( 'None', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/none.png' ) );
[218] Fix | Delete
}
[219] Fix | Delete
[220] Fix | Delete
$layouts['1'] = array( 'title' => esc_html__( 'Layout 1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_fa1.png' ) );
[221] Fix | Delete
$layouts['2'] = array( 'title' => esc_html__( 'Layout 2', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_fa2.png' ) );
[222] Fix | Delete
$layouts['3'] = array( 'title' => esc_html__( 'Layout 3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_fa3.png' ) );
[223] Fix | Delete
$layouts['4'] = array( 'title' => esc_html__( 'Layout 4', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_fa4.png' ) );
[224] Fix | Delete
$layouts['5'] = array( 'title' => esc_html__( 'Layout 5', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/layout_fa5.png' ) );
[225] Fix | Delete
[226] Fix | Delete
$layouts = apply_filters( 'herald_modify_featured_layouts', $layouts ); //Allow child themes or plugins to modify
[227] Fix | Delete
return $layouts;
[228] Fix | Delete
[229] Fix | Delete
}
[230] Fix | Delete
endif;
[231] Fix | Delete
[232] Fix | Delete
[233] Fix | Delete
[234] Fix | Delete
/**
[235] Fix | Delete
* Get the list of available authors layouts
[236] Fix | Delete
*
[237] Fix | Delete
* @param bool $ihnerit Whether you want to add "inherit" option
[238] Fix | Delete
* @param bool $none Whether you want to add "none" option ( to set layout to "off")
[239] Fix | Delete
* @param array $exclude Array to optionally exclude some of layouts
[240] Fix | Delete
* @return array List of available options
[241] Fix | Delete
* @since 1.0
[242] Fix | Delete
*/
[243] Fix | Delete
[244] Fix | Delete
if ( !function_exists( 'herald_get_author_layouts' ) ):
[245] Fix | Delete
function herald_get_author_layouts( $inherit = false, $none = false, $exclude = array() ) {
[246] Fix | Delete
[247] Fix | Delete
$layouts['col1'] = array( 'title' => esc_html__( 'Layout 1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/authors_layout_1.png' ), 'col' => 12 );
[248] Fix | Delete
$layouts['col2'] = array( 'title' => esc_html__( 'Layout 2', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/authors_layout_2.png' ), 'col' => 12 );
[249] Fix | Delete
$layouts['col3'] = array( 'title' => esc_html__( 'Layout 3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/authors_layout_3.png' ), 'col' => 12 );
[250] Fix | Delete
[251] Fix | Delete
if ( !empty( $exclude ) ) {
[252] Fix | Delete
[253] Fix | Delete
foreach ( $exclude as $layout ) {
[254] Fix | Delete
if ( array_key_exists( $layout, $layouts ) ) {
[255] Fix | Delete
unset( $layouts[$layout] );
[256] Fix | Delete
}
[257] Fix | Delete
}
[258] Fix | Delete
}
[259] Fix | Delete
[260] Fix | Delete
$layouts = apply_filters( 'herald_modify_author_layouts', $layouts ); //Allow child themes or plugins to modify
[261] Fix | Delete
return $layouts;
[262] Fix | Delete
[263] Fix | Delete
}
[264] Fix | Delete
endif;
[265] Fix | Delete
[266] Fix | Delete
[267] Fix | Delete
[268] Fix | Delete
/**
[269] Fix | Delete
* Get the list of available sidebar layouts
[270] Fix | Delete
*
[271] Fix | Delete
* You may have left sidebar, right sidebar or no sidebar
[272] Fix | Delete
*
[273] Fix | Delete
* @param bool $ihnerit Whether you want to include "inherit" option in the list
[274] Fix | Delete
* @return array List of available sidebar layouts
[275] Fix | Delete
* @since 1.0
[276] Fix | Delete
*/
[277] Fix | Delete
[278] Fix | Delete
if ( !function_exists( 'herald_get_sidebar_layouts' ) ):
[279] Fix | Delete
function herald_get_sidebar_layouts( $inherit = false ) {
[280] Fix | Delete
[281] Fix | Delete
$layouts = array();
[282] Fix | Delete
[283] Fix | Delete
if ( $inherit ) {
[284] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ) );
[285] Fix | Delete
}
[286] Fix | Delete
[287] Fix | Delete
$layouts['none'] = array( 'title' => esc_html__( 'None', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/none.png' ) );
[288] Fix | Delete
$layouts['left'] = array( 'title' => esc_html__( 'Left sidebar', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/content_sid_left.png' ) );
[289] Fix | Delete
$layouts['right'] = array( 'title' => esc_html__( 'Right sidebar', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/content_sid_right.png' ) );
[290] Fix | Delete
[291] Fix | Delete
$layouts = apply_filters( 'herald_modify_sidebar_layouts', $layouts ); //Allow child themes or plugins to modify
[292] Fix | Delete
return $layouts;
[293] Fix | Delete
}
[294] Fix | Delete
endif;
[295] Fix | Delete
[296] Fix | Delete
/**
[297] Fix | Delete
* Get the list of available pagination types
[298] Fix | Delete
*
[299] Fix | Delete
* @param bool $ihnerit Whether you want to include "inherit" option in the list
[300] Fix | Delete
* @param bool $none Whether you want to add "none" option ( to set layout to "off")
[301] Fix | Delete
* @return array List of available options
[302] Fix | Delete
* @since 1.0
[303] Fix | Delete
*/
[304] Fix | Delete
[305] Fix | Delete
if ( !function_exists( 'herald_get_pagination_layouts' ) ):
[306] Fix | Delete
function herald_get_pagination_layouts( $inherit = false, $none = false ) {
[307] Fix | Delete
[308] Fix | Delete
$layouts = array();
[309] Fix | Delete
[310] Fix | Delete
if ( $inherit ) {
[311] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ) );
[312] Fix | Delete
}
[313] Fix | Delete
[314] Fix | Delete
if ( $none ) {
[315] Fix | Delete
$layouts['none'] = array( 'title' => esc_html__( 'None', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/none.png' ) );
[316] Fix | Delete
}
[317] Fix | Delete
[318] Fix | Delete
$layouts['numeric'] = array( 'title' => esc_html__( 'Numeric pagination links', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/pag_numeric.png' ) );
[319] Fix | Delete
$layouts['prev-next'] = array( 'title' => esc_html__( 'Prev/Next page links', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/pag_prev_next.png' ) );
[320] Fix | Delete
$layouts['load-more'] = array( 'title' => esc_html__( 'Load more button', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/pag_load_more.png' ) );
[321] Fix | Delete
$layouts['infinite-scroll'] = array( 'title' => esc_html__( 'Infinite scroll', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/pag_infinite.png' ) );
[322] Fix | Delete
[323] Fix | Delete
$layouts = apply_filters( 'herald_modify_pagination_layouts', $layouts ); //Allow child themes or plugins to modify
[324] Fix | Delete
return $layouts;
[325] Fix | Delete
}
[326] Fix | Delete
endif;
[327] Fix | Delete
[328] Fix | Delete
/**
[329] Fix | Delete
* Get the list of available meta bar layouts
[330] Fix | Delete
*
[331] Fix | Delete
*
[332] Fix | Delete
* @param bool $ihnerit Whether you want to include "inherit" option in the list
[333] Fix | Delete
* @return array List of available meta bar layouts
[334] Fix | Delete
* @since 1.3
[335] Fix | Delete
*/
[336] Fix | Delete
[337] Fix | Delete
if ( !function_exists( 'herald_get_meta_bar_layouts' ) ):
[338] Fix | Delete
function herald_get_meta_bar_layouts( $inherit = false ) {
[339] Fix | Delete
[340] Fix | Delete
$layouts = array();
[341] Fix | Delete
[342] Fix | Delete
if ( $inherit ) {
[343] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ) );
[344] Fix | Delete
}
[345] Fix | Delete
[346] Fix | Delete
$layouts['left'] = array( 'title' => esc_html__( 'Left', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/meta_left.png' ) );
[347] Fix | Delete
$layouts['right'] = array( 'title' => esc_html__( 'Right', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/meta_right.png' ) );
[348] Fix | Delete
$layouts['none'] = array( 'title' => esc_html__( 'None', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/meta_none.png' ) );
[349] Fix | Delete
[350] Fix | Delete
$layouts = apply_filters( 'herald_modify_meta_bar_layouts', $layouts ); //Allow child themes or plugins to modify
[351] Fix | Delete
return $layouts;
[352] Fix | Delete
}
[353] Fix | Delete
endif;
[354] Fix | Delete
[355] Fix | Delete
[356] Fix | Delete
/**
[357] Fix | Delete
* Get the list of registered sidebars
[358] Fix | Delete
*
[359] Fix | Delete
* @param bool $ihnerit Whether you want to include "inherit" option in the list
[360] Fix | Delete
* @return array Returns list of available sidebars
[361] Fix | Delete
* @since 1.0
[362] Fix | Delete
*/
[363] Fix | Delete
[364] Fix | Delete
if ( !function_exists( 'herald_get_sidebars_list' ) ):
[365] Fix | Delete
function herald_get_sidebars_list( $inherit = false ) {
[366] Fix | Delete
[367] Fix | Delete
$sidebars = array();
[368] Fix | Delete
[369] Fix | Delete
if ( $inherit ) {
[370] Fix | Delete
$sidebars['inherit'] = esc_html__( 'Inherit', 'herald' );
[371] Fix | Delete
}
[372] Fix | Delete
[373] Fix | Delete
$sidebars['none'] = esc_html__( 'None', 'herald' );
[374] Fix | Delete
[375] Fix | Delete
global $wp_registered_sidebars;
[376] Fix | Delete
[377] Fix | Delete
if ( !empty( $wp_registered_sidebars ) ) {
[378] Fix | Delete
[379] Fix | Delete
foreach ( $wp_registered_sidebars as $sidebar ) {
[380] Fix | Delete
$sidebars[$sidebar['id']] = $sidebar['name'];
[381] Fix | Delete
}
[382] Fix | Delete
[383] Fix | Delete
}
[384] Fix | Delete
//Get sidebars from wp_options if global var is not loaded yet
[385] Fix | Delete
$fallback_sidebars = get_option( 'herald_registered_sidebars' );
[386] Fix | Delete
if ( !empty( $fallback_sidebars ) ) {
[387] Fix | Delete
foreach ( $fallback_sidebars as $sidebar ) {
[388] Fix | Delete
if ( !array_key_exists( $sidebar['id'], $sidebars ) ) {
[389] Fix | Delete
$sidebars[$sidebar['id']] = $sidebar['name'];
[390] Fix | Delete
}
[391] Fix | Delete
}
[392] Fix | Delete
}
[393] Fix | Delete
[394] Fix | Delete
//Check for theme additional sidebars
[395] Fix | Delete
$custom_sidebars = herald_get_option( 'sidebars' );
[396] Fix | Delete
[397] Fix | Delete
if ( $custom_sidebars ) {
[398] Fix | Delete
foreach ( $custom_sidebars as $k => $title ) {
[399] Fix | Delete
if ( is_numeric( $k ) && !array_key_exists( 'herald_sidebar_'.$k, $sidebars ) ) {
[400] Fix | Delete
$sidebars['herald_sidebar_'.$k] = $title;
[401] Fix | Delete
}
[402] Fix | Delete
}
[403] Fix | Delete
}
[404] Fix | Delete
[405] Fix | Delete
//Do not display footer sidebars for selection
[406] Fix | Delete
unset( $sidebars['herald_footer_sidebar_1'] );
[407] Fix | Delete
unset( $sidebars['herald_footer_sidebar_2'] );
[408] Fix | Delete
unset( $sidebars['herald_footer_sidebar_3'] );
[409] Fix | Delete
unset( $sidebars['herald_footer_sidebar_4'] );
[410] Fix | Delete
[411] Fix | Delete
$sidebars = apply_filters( 'herald_modify_sidebars_list', $sidebars ); //Allow child themes or plugins to modify
[412] Fix | Delete
return $sidebars;
[413] Fix | Delete
}
[414] Fix | Delete
endif;
[415] Fix | Delete
[416] Fix | Delete
[417] Fix | Delete
/**
[418] Fix | Delete
* Get the list of single post layouts
[419] Fix | Delete
*
[420] Fix | Delete
* @param bool $ihnerit Whether you want to add "inherit" option or not
[421] Fix | Delete
* @return array Returns list of available options
[422] Fix | Delete
* @since 1.0
[423] Fix | Delete
*/
[424] Fix | Delete
[425] Fix | Delete
if ( !function_exists( 'herald_get_single_layouts' ) ):
[426] Fix | Delete
function herald_get_single_layouts( $inherit = false ) {
[427] Fix | Delete
[428] Fix | Delete
$layouts = array();
[429] Fix | Delete
[430] Fix | Delete
if ( $inherit ) {
[431] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ) );
[432] Fix | Delete
}
[433] Fix | Delete
[434] Fix | Delete
$layouts['1'] = array( 'title' => esc_html__( 'Layout 1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_1.png' ) );
[435] Fix | Delete
$layouts['2'] = array( 'title' => esc_html__( 'Layout 2', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_2.png' ) );
[436] Fix | Delete
$layouts['3'] = array( 'title' => esc_html__( 'Layout 3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_3.png' ) );
[437] Fix | Delete
$layouts['4'] = array( 'title' => esc_html__( 'Layout 4', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_4.png' ) );
[438] Fix | Delete
$layouts['5'] = array( 'title' => esc_html__( 'Layout 5', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_5.png' ) );
[439] Fix | Delete
$layouts['6'] = array( 'title' => esc_html__( 'Layout 6', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_6.png' ) );
[440] Fix | Delete
$layouts['7'] = array( 'title' => esc_html__( 'Layout 7', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_7.png' ) );
[441] Fix | Delete
$layouts['8'] = array( 'title' => esc_html__( 'Layout 8', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_8.png' ) );
[442] Fix | Delete
$layouts['9'] = array( 'title' => esc_html__( 'Layout 9', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/single_9.png' ) );
[443] Fix | Delete
[444] Fix | Delete
$layouts = apply_filters( 'herald_modify_single_layouts', $layouts ); //Allow child themes or plugins to modify
[445] Fix | Delete
return $layouts;
[446] Fix | Delete
}
[447] Fix | Delete
endif;
[448] Fix | Delete
[449] Fix | Delete
[450] Fix | Delete
/**
[451] Fix | Delete
* Get the list of page layouts
[452] Fix | Delete
*
[453] Fix | Delete
* @param bool $ihnerit Whether you want to add "inherit" option or not
[454] Fix | Delete
* @return array Returns list of available options
[455] Fix | Delete
* @since 1.0
[456] Fix | Delete
*/
[457] Fix | Delete
[458] Fix | Delete
if ( !function_exists( 'herald_get_page_layouts' ) ):
[459] Fix | Delete
function herald_get_page_layouts( $inherit = false ) {
[460] Fix | Delete
[461] Fix | Delete
$layouts = array();
[462] Fix | Delete
[463] Fix | Delete
if ( $inherit ) {
[464] Fix | Delete
$layouts['inherit'] = array( 'title' => esc_html__( 'Inherit', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/inherit.png' ) );
[465] Fix | Delete
}
[466] Fix | Delete
[467] Fix | Delete
$layouts['1'] = array( 'title' => esc_html__( 'Layout 1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/page_1.png' ) );
[468] Fix | Delete
$layouts['2'] = array( 'title' => esc_html__( 'Layout 2', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/page_2.png' ) );
[469] Fix | Delete
$layouts['3'] = array( 'title' => esc_html__( 'Layout 3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/page_3.png' ) );
[470] Fix | Delete
$layouts['4'] = array( 'title' => esc_html__( 'Layout 4', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/page_4.png' ) );
[471] Fix | Delete
$layouts['5'] = array( 'title' => esc_html__( 'Layout 5', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/page_5.png' ) );
[472] Fix | Delete
$layouts['6'] = array( 'title' => esc_html__( 'Layout 6', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/page_6.png' ) );
[473] Fix | Delete
[474] Fix | Delete
$layouts = apply_filters( 'herald_modify_page_layouts', $layouts ); //Allow child themes or plugins to modify
[475] Fix | Delete
return $layouts;
[476] Fix | Delete
}
[477] Fix | Delete
endif;
[478] Fix | Delete
[479] Fix | Delete
[480] Fix | Delete
/**
[481] Fix | Delete
* Get module columns
[482] Fix | Delete
*
[483] Fix | Delete
* It gets the list of options to specify width of a module
[484] Fix | Delete
*
[485] Fix | Delete
* @return array Available options
[486] Fix | Delete
* @since 1.0
[487] Fix | Delete
*/
[488] Fix | Delete
[489] Fix | Delete
if ( !function_exists( 'herald_get_module_columns' ) ):
[490] Fix | Delete
function herald_get_module_columns() {
[491] Fix | Delete
[492] Fix | Delete
$options['12'] = array( 'title' => esc_html__( '1/1', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/col_12.png' ) );
[493] Fix | Delete
$options['6'] = array( 'title' => esc_html__( '1/2', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/col_6.png' ) );
[494] Fix | Delete
$options['4'] = array( 'title' => esc_html__( '1/3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/col_4.png' ) );
[495] Fix | Delete
$options['8'] = array( 'title' => esc_html__( '2/3', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/col_8.png' ) );
[496] Fix | Delete
$options['3'] = array( 'title' => esc_html__( '1/4', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/col_3.png' ) );
[497] Fix | Delete
$options['9'] = array( 'title' => esc_html__( '3/4', 'herald' ), 'img' => get_parent_theme_file_uri( '/assets/img/admin/col_9.png' ) );
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function