'
)
);
}
add_action( 'widgets_init', 'azera_shop_widgets_init' );
/**
* Fallback Menu
*
* If the menu doesn't exist, the fallback function to use.
*/
function azera_shop_wp_page_menu() {
echo '
';
}
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
/* tgm-plugin-activation */
require_once get_template_directory() . '/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'azera_shop_register_required_plugins' );
function azera_shop_register_required_plugins() {
$plugins = array(
array(
'name' => 'Intergeo Maps - Google Maps Plugin',
'slug' => 'intergeo-maps',
'required' => false
),
array(
'name' => 'Pirate Forms',
'slug' => 'pirate-forms',
'required' => false
),
array(
'name' => 'WooCommerce',
'slug' => 'woocommerce',
'required' => false
),
array(
'name' => 'Azera Shop Companion',
'slug' => 'azera-shop-companion',
'required' => false
)
);
$config = array(
'default_path' => '',
'menu' => 'tgmpa-install-plugins',
'has_notices' => true,
'dismissable' => true,
'dismiss_msg' => '',
'is_automatic' => false,
'message' => '',
'strings' => array(
'page_title' => esc_html__( 'Install Required Plugins', 'azera-shop' ),
'menu_title' => esc_html__( 'Install Plugins', 'azera-shop' ),
'installing' => esc_html__( 'Installing Plugin: %s', 'azera-shop' ),
'oops' => esc_html__( 'Something went wrong with the plugin API.', 'azera-shop' ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'azera-shop' ),
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'azera-shop' ),
'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'azera-shop' ),
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'azera-shop' ),
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.', 'azera-shop' ),
'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'azera-shop' ),
'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'azera-shop' ),
'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'azera-shop' ),
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins', 'azera-shop' ),
'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'azera-shop' ),
'return' => esc_html__( 'Return to Required Plugins Installer', 'azera-shop' ),
'plugin_activated' => esc_html__( 'Plugin activated successfully.', 'azera-shop' ),
'complete' => esc_html__( 'All plugins installed and activated successfully. %s', 'azera-shop' ),
'nag_type' => 'updated'
)
);
tgmpa( $plugins, $config );
}
add_action('wp_footer','azera_shop_php_style', 100);
function azera_shop_php_style() {
echo '';
}
$pro_functions_path = azera_shop_get_file('/pro/functions.php');
if (file_exists($pro_functions_path)) {
require $pro_functions_path;
}
function azera_shop_get_file($file){
$file_parts = pathinfo($file);
$accepted_ext = array('jpg','img','png','css','js');
if( in_array($file_parts['extension'], $accepted_ext) ){
$file_path = get_stylesheet_directory() . $file;
if ( file_exists( $file_path ) ){
return esc_url(get_stylesheet_directory_uri() . $file);
} else {
return esc_url(get_template_directory_uri() . $file);
}
}
}
/**
* WooCommerce Extra Feature
* --------------------------
*
* Change number of related products on product page
* Set your own value for 'posts_per_page'
*
*/
add_filter( 'woocommerce_output_related_products_args', 'azera_shop_related_products_args' );
function azera_shop_related_products_args( $args ) {
$args['posts_per_page'] = 4;
$args['columns'] = 4;
return $args;
}
function azera_shop_responsive_embed($html, $url, $attr, $post_ID) {
$return = '