'Contact Form 7',
'slug' => 'contact-form-7',
'required' => true,
'force_activation' => true
)
);
$config = array(
'default_path' => '', // Default absolute path to pre-packaged plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => true, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
'strings' => array(
'page_title' => __( 'Install Required Plugins', 'air' ),
'menu_title' => __( 'Install Plugins', 'air' ),
'installing' => __( 'Installing Plugin: %s', 'air' ), // %s = plugin name.
'oops' => __( 'Something went wrong with the plugin API.', 'air' ),
'notice_can_install_required' => _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.', 'air' ), // %1$s = plugin name(s).
'notice_can_install_recommended' => _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.', 'air' ), // %1$s = plugin name(s).
'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.', 'air' ), // %1$s = plugin name(s).
'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'air' ), // %1$s = plugin name(s).
'notice_can_activate_recommended' => _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' , 'air' ), // %1$s = plugin name(s).
'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.' , 'air' ), // %1$s = plugin name(s).
'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.' , 'air' ), // %1$s = plugin name(s).
'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.', 'air' ), // %1$s = plugin name(s).
'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' , 'air' ),
'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins', 'air' ),
'return' => __( 'Return to Required Plugins Installer', 'air' ),
'plugin_activated' => __( 'Plugin activated successfully.', 'air' ),
'complete' => __( 'All plugins installed and activated successfully. %s', 'air' ), // %s = dashboard link.
'nag_type' => 'updated' // Determines admin notice type - can only be 'updated', 'update-nag' or 'error'.
)
);
tgmpa($plugins, $config);
}
/** remove redux menu under the tools **/
add_action( 'admin_menu', 'remove_redux_menu',12 );
function remove_redux_menu() {
remove_submenu_page('tools.php','redux-about');
}
/*
* Gets the image id by providing and URL.
*/
function get_image_id($image_url) {
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
return $attachment != false ? $attachment[0] : false;
}
/*
* Returns the URL of an image size by providing the URL to the original size.
*/
function get_custom_add_image_from_default_url($url, $size_name) {
$attachment_id = get_image_id($url);
if($attachment_id != false) {
$image_src = wp_get_attachment_image_src($attachment_id, $size_name);
return $image_src!= false ? $image_src[0] : $url;
} else {
return $url;
}
}
if ( ! function_exists( 'navthemes_entry_meta' ) ) :
/**
* Set up post entry meta.
*/
function navthemes_entry_meta() {
// Translators: used between list items, there is a space after the comma.
$categories_list = ''. get_the_category_list( __( ', ', 'air' ) ) . "";
$date = sprintf( '',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$author = sprintf( '%3$s',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'air' ), get_the_author() ) ),
get_the_author()
);
$comment_number = get_comments_number();
$comment_number = sprintf( _n( '1 Comment', '%s Comments', $comment_number, 'air' ), $comment_number );
$comment_number = sprintf( ' %2$s',
get_comments_link(),
$comment_number
);
// Translators: used between list items, there is a space after the comma.
$tag_list = ' '. get_the_tag_list( '', __( ', ', 'air' ) ). '';
$utility_text = __( ' %1$s %3$s %4$s %5$s %2$s ', 'air' );
// Translators: 1 is category, 2 is tag, 3 is the date, 4 is the author's name and 5 is comments.
echo $categories_list ;
echo $date ;
echo $author ;
echo $comment_number ;
echo $tag_list ;
}
endif;
// Get Resized image from url
function get_resized_only_image_from_url($image_url, $image_name){
/**
@param
$image_url = image path
$image_name = Resized image name from add_image_size()
*/
if(empty($image_url)) return ;
// check if default value
global $default_images;
//if(contains($image_url,$default_images)) return $image_url;
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url ));
$image = wp_get_attachment_image_src( $attachment[0], $image_name);
return $image[0];
}