';
if(!boatseller_isboatdealer())
$bd_msg = '
';
else
$bd_msg = '
';
$bd_msg .= '
';
$bd_msg .= esc_html__('BoatSeller theme was activated!', "boatseller");
$bd_msg .= '
';
$bd_msg .= '
';
// $bd_msg .= esc_html__("To manage go to Dashboard => Appearance => Customize", "boatseller");
$bd_msg .= '
For details and help, take a look at our Help Page at your left menu';
$bd_msg .= '
';
$bd_msg .= 'Appearance => Boat Seller Help';
$bd_msg .= '
';
$bd_msg .= ' Help Page';
$bd_msg .= ' ';
$bd_msg .= '
';
if(!boatseller_isboatdealer())
{
$bd_msg .= '';
$bd_msg .= esc_html__('Suggestion: install and activate the free BOAT DEALER PLUGIN from WordPress plugins repository.', "boatseller");
}
echo $bd_msg;
echo "
";
}
function boatseller_activ_enqueue()
{
add_action( 'admin_notices', 'boatseller_activ_message' );
}
if(is_admin())
{
add_action('after_switch_theme', 'boatseller_activ_enqueue');
require_once boatsellerPATH . '/inc/help.php';
require_once (boatsellerPATH . '/inc/health.php');
}
/**
* Add support for Gutenberg.
*
* @link https://wordpress.org/gutenberg/handbook/reference/theme-support/
*/
function boatseller_setup_theme_supported_features() {
// Theme supports wide images, galleries and videos.
add_theme_support( 'align-wide' );
// Make specific theme colors available in the editor.
}
add_action( 'after_setup_theme', 'boatseller_setup_theme_supported_features' );
function memory_status()
{
$ret = false;
if (defined("WP_MEMORY_LIMIT")) {
$wplimite = trim(WP_MEMORY_LIMIT);
$wplimite = substr($wplimite, 0, strlen($wplimite) - 1);
if ($wplimite >= 128)
$ret = true;
}
return $ret;
}
/**
* Enqueue editor styles for Gutenberg
*/
function boatseller_gutenberg_colors() {
/* Background */
$color_scheme = boatseller_get_color_scheme();
$default_color = $color_scheme[1];
$css = boatseller_page_background_color_css2();
$page_background_color = $default_color;
$page_background_color = sanitize_hex_color(get_theme_mod( 'page_background_color', $default_color ));
return wp_strip_all_tags(sprintf( $css, $page_background_color));
/* End Background */
}
function boatseller_gutenberg_colors2() {
/* Foreground */
$color_scheme = boatseller_get_color_scheme();
$default_color = $color_scheme[3];
$main_text_color = sanitize_hex_color(get_theme_mod( 'main_text_color', $color_scheme[3] ));
$color_textcolor_rgb = boatseller_hex2rgb( $main_text_color );
// If the rgba values are empty return early.
if ( empty( $color_textcolor_rgb ) ) {
return;
}
// If we get this far, we have a custom color scheme.
$colors = array(
'background_color' => $color_scheme[0],
'page_background_color' => $color_scheme[1],
'link_color' => $color_scheme[2],
'main_text_color' => $main_text_color,
'secondary_text_color' => $color_scheme[4],
'footer_color' => $color_scheme[5],
'border_color' => vsprintf( 'rgba( %1$s, %2$s, %3$s, 0.2)', $color_textcolor_rgb ),
);
$color_scheme_css = boatseller_get_color_scheme_css2( $colors );
return wp_strip_all_tags($color_scheme_css);
/* End Foreground */
}
function boatseller_gutenberg_editor_styles() {
wp_enqueue_style( 'boatseller_gutenberg-editor-style', get_template_directory_uri() . '/css/gutenberg-editor-style.css' );
// Add custom colors to Gutenberg.
wp_add_inline_style( 'boatseller_gutenberg-editor-style', boatseller_gutenberg_colors() );
wp_add_inline_style( 'boatseller_gutenberg-editor-style', boatseller_gutenberg_colors2() );
}
if(is_admin())
add_action( 'enqueue_block_editor_assets', 'boatseller_gutenberg_editor_styles' );
function boatseller_page_background_color_css2() {
/* Custom Page Background Color */
$css = '
.site, .edit-post-layout__content
{
background-color: %1$s;
}
mark,
ins,
button,
button[disabled]:hover,
button[disabled]:focus,
input[type="button"],
input[type="button"][disabled]:hover,
input[type="button"][disabled]:focus,
input[type="reset"],
input[type="reset"][disabled]:hover,
input[type="reset"][disabled]:focus,
input[type="submit"],
input[type="submit"][disabled]:hover,
input[type="submit"][disabled]:focus,
.menu-toggle.toggled-on,
.menu-toggle.toggled-on:hover,
.menu-toggle.toggled-on:focus,
.pagination .prev,
.pagination .next,
.pagination .prev:hover,
.pagination .prev:focus,
.pagination .next:hover,
.pagination .next:focus,
.pagination .nav-links:before,
.pagination .nav-links:after,
.widget_calendar tbody a,
.widget_calendar tbody a:hover,
.widget_calendar tbody a:focus,
.page-links a,
.page-links a:hover,
.page-links a:focus
{
color: %1$s;
}
@media screen and (min-width: 56.875em) {
.main-navigation ul ul li {
background-color: %1$s;
}
.main-navigation ul ul:after {
border-top-color: %1$s;
border-bottom-color: %1$s;
}
}
';
return $css;
}
function boatseller_get_color_scheme_css2( $colors ) {
$colors = wp_parse_args( $colors, array(
'background_color' => '',
'page_background_color' => '',
'link_color' => '',
'main_text_color' => '',
'secondary_text_color' => '',
'footer_color' => '',
'border_color' => '',
) );
return <<