'.__('Media are accessible over HTTPS.', 'add-meta-tags').'
'.__('Currently this option, if enabled, lets the plugin make decisions about whether to generate additional secure links even if the active connection does not use HTTPS. For instance, if the web site is accessed over HTTP and this options is enabled, additional og:image:secure_url meta tags will be generated for your local media. If the current connection uses HTTPS, then secure links are always generated.', 'add-meta-tags').'
'.__('Media Limit', 'add-meta-tags').'
'.__('Do not generate metadata for more than one media file of each type (image, video, audio).', 'add-meta-tags').'
'.__('By default, metadata is generated for all media files that have been attached or embedded in the content. By enabling this option Add-Meta-Tags will generate metadata only for the first media file of each type (image, video, audio) it encounters. This limit does not affect the gallery Twitter Card, which always contains all the attached images.', 'add-meta-tags').'
'.__('Review Mode', 'add-meta-tags').'
'.__('If enabled, WordPress users with administrator privileges see a box (right above the post\'s content) containing the metadata exactly as it is added in the HTML head and body. The box is displayed for posts, pages, attachments and custom post types.', 'add-meta-tags').'
'.__('Enable keyword analysis and statistics', 'add-meta-tags').'
'.__('If enabled, a section containing statistical information about the metadata and the content is also displayed in the review mode panel.', 'add-meta-tags').'
'.__('Omit help messages and notices', 'add-meta-tags').'
'.__('If enabled, help messages and other notices are no longer displayed in the metadata review panel.', 'add-meta-tags').'
'.__('This section contains information about the metadata Add-Meta-Tags can generate for third party content.', 'add-meta-tags').'
'.__('Metadata for WooCommerce', 'add-meta-tags').'
'.__('Add-Meta-Tags can generate metadata for WooCommerce products and product groups. The Basic, Opengraph, Twitter Cards, Schema.org microdata and Schema.org JSON+LD metadata generators have been implemented.', 'add-meta-tags').'
'.__('The generated metadata is complete and supports most of the properties of products and offers, except shipping related information. Product attributes are also supported. In some cases, you will have to override the associations between the names of product attributes the plugin expects and the names of product attributes that are actually used.', 'add-meta-tags').'
'.__('Products with regular and sales prices are supported. Variable products and pages of product groups are also supported.', 'add-meta-tags').'
'.__('The metadata generators for WooCommerce products should be considered stable. However, your comments and suggestions are welcome.', 'add-meta-tags').'
'.__('Metadata for Easy Digital Downloads', 'add-meta-tags').'
'.__('Support for the products and product groups of the Easy Digital Downloads plugin is still work in progress. If enabled, product and product group pages will contain basic product related metadata.', 'add-meta-tags').'
'.__('Metadata for BuddyPress', 'add-meta-tags').'
'.__('Add-Meta-Tags can generate metadata for BuddyPress member profile pages. The Basic, Opengraph, Twitter Cards, Schema.org microdata and Schema.org JSON+LD metadata generators have been implemented.', 'add-meta-tags').'
'.__('If the Extended Profiles component has not been activated in BuddyPress, then metadata is generated based on the information found in the WordPress user profile.', 'add-meta-tags').'
'.__('Please consult the wiki documentation about BuddyPress for more information about how to modify or extend the generated metadata, override the default field map or prevent profile metadata from being added to the profile page.', 'add-meta-tags').'
'.__('How to fully take advantage of this feature:', 'add-meta-tags').'
'.__('Enable BuddyPress support in the Add-Meta-Tags settings.', 'add-meta-tags').'
'.__('Set the source of local author profiles to BuddyPress in the Add-Meta-Tags settings.', 'add-meta-tags').' ('.__('Optional', 'add-meta-tags').')
'.__('Use the amt_local_author_profile_url() template tag in your theme templates in order to generate a URL to the author\'s profile. This template tag takes your selection about the source of local author profiles into account.', 'add-meta-tags').' ('.__('Optional', 'add-meta-tags').')
'.__('This is a new feature and should be considered work in progress.', 'add-meta-tags').'
'.__('Metadata for bbPress', 'add-meta-tags').'
'.__('Metadata for bbPress forums and topics should be generated out of the box. More specific forum metadata has not been implemented yet.', 'add-meta-tags').'
'.__('Currently, only the base mechanism exists, which lets you modify or extend metadata for bbPress forums and topics.', 'add-meta-tags').'
'.__('Please, don\'t forget to contribute your customizations to this project!', 'add-meta-tags').'
'.__('This section contains basic information about the metadata caching feature. For more details about how metadata caching works in Add-Meta-Tags, troubleshooting notes and also helpful information that aims to help you decide whether you need to enable this feature or not can be found in the Performance page of the wiki.', 'add-meta-tags').'
'.__('Metadata caching is the last thing you should care about while configuring this plugin. You should consider enabling it only after you have finished configuring the rest of the settings.', 'add-meta-tags').'
'.__('Notice', 'add-meta-tags').'
'.__('Metadata caching is an experimental feature, which should only be used by experienced WordPress users. If you are a WordPress beginner or if you don\'t have enough knowledge about the concept of caching and, especially, if you have followed instructions without having understood how this works, please keep this feature turned off, read this section of the documentation and also the Performance page of the wiki carefully and ask any questions you might have before enabling it. Even if you do otherwise, your web site is not going to be harmed in any way, but it is always a good idea to have a good understanding about how things work.', 'add-meta-tags').'
'.__('If this option is enabled, information about the total time that was required to generate a block of metadata is printed. This feature, generally, should not be enabled, unless you want an indication of the metadata generation times in each request.', 'add-meta-tags').'
'.__('Metadata caching can be enabled by setting the caching timeout, which is the number of seconds for which the metadata should be cached, to a number greater than zero. The cache is cleared every time you save the Add-Meta-Tags settings or from the command line using the amt command of wp-cli.', 'add-meta-tags').'
'.__('The full documentation of this feature has been moved to the Performance page of the wiki. It is highly recommended to thoroughly study this document before enabling metadata caching.', 'add-meta-tags').'
'.__('Add-Meta-Tags can be customized to a great extent programmatically. Please read the Add-Meta-Tags Cookbook for more information.', 'add-meta-tags').'
';
$screen->add_help_tab( array(
'id' => 'amt_help_advanced',
'title' => __('Advanced', 'add-meta-tags'),
'content' => $help_text,
) );
}
/**
* Function that adds the help tabs for the options.
*/
function amt_options_page() {
// Permission Check
if ( !current_user_can( 'manage_options' ) ) {
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
}
// Default Add-Meta-Tags Settings
$default_options = amt_get_default_options();
if (isset($_POST['info_update'])) {
// Save the Add-Meta-Tags settings
amt_save_settings($_POST);
// Also, since it may happen that the rewrite rules have not been flushed
// this is a good place to do it.
flush_rewrite_rules();
// Also, clear the metadata cache automatically on every save.
$result = amt_delete_all_transient_metadata_cache();
if ( intval($result) > 0 ) {
amt_show_info_msg( sprintf(__('Deleted %d transient metadata cache entries.', 'add-meta-tags'), $result) );
}
} elseif (isset($_POST["info_reset"])) {
amt_reset_settings();
}
// Get the options from the DB.
$options = get_option("add_meta_tags_opts");
//var_dump($options);
/*
Configuration Page
*/
print('
');
print('
'.__('Metadata Settings', 'add-meta-tags').'
'.__('Welcome to the administration panel of the Add-Meta-Tags plugin.', 'add-meta-tags').'
'.__('Press the Help button on the top right corner for an introduction to metadata and also for detailed documentation about the available settings and the metadata generators. All help texts will gradually be moved to this integrated WordPress help system in order to reduce the size of this page and make it more user-friendly.', 'add-meta-tags').'
'.__('Configuration', 'add-meta-tags').'
'.__('This section contains global configuration options for the metadata that is added to your web site.', 'add-meta-tags').'
');
print('
');
}
//
//
// Metadata metabox in post/page editing panel.
//
//
function amt_post_edit_metabox_enqueue_scripts($hook) {
// Enqueue only on profile page.
if ( ! in_array($hook, array('post.php', 'post-new.php')) ) {
return;
}
// $supported_types = amt_get_post_types_for_metabox();
// See: #900 for details
// Using included Jquery
wp_enqueue_script('jquery');
// For tabs
// wp_enqueue_script('jquery-ui-core');
// wp_enqueue_script('jquery-ui-widget');
// wp_enqueue_script('jquery-ui-tabs');
// Necessary for the media selector.
// https://codex.wordpress.org/Javascript_Reference/wp.media
wp_enqueue_media();
// For tabs
//wp_register_style( 'amt-jquery-ui-core', plugins_url('css/jquery.ui.core.css', AMT_PLUGIN_FILE) );
//wp_enqueue_style( 'amt-jquery-ui-core' );
//wp_register_style( 'amt-jquery-ui-tabs', plugins_url('css/jquery.ui.tabs.css', AMT_PLUGIN_FILE) );
//wp_enqueue_style( 'amt-jquery-ui-tabs' );
// wp_register_style( 'amt-metabox-tabs', plugins_url('css/amt-metabox-tabs.css', AMT_PLUGIN_FILE) );
// wp_enqueue_style( 'amt-metabox-tabs' );
// Register Add-Meta-Tags admin scripts
wp_register_script( 'amt_image_selector_script', plugins_url( 'js/amt-image-selector.js', AMT_PLUGIN_FILE ), array('jquery') );
// Enqueue the Add-Meta-Tags Admin Scripts
wp_enqueue_script( 'amt_image_selector_script' );
}
add_action( 'admin_enqueue_scripts', 'amt_post_edit_metabox_enqueue_scripts' );
/* Define the custom box */
add_action( 'add_meta_boxes', 'amt_add_metadata_box' );
/**
* Adds a box to the main column of the editing panel of the supported post types.
* See the amt_get_post_types_for_metabox() docstring for more info on the supported types.
*/
function amt_add_metadata_box() {
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Global Metadata metabox permission check (can be user customized via filter).
if ( ! current_user_can( $metabox_permissions['global_metabox_capability'] ) ) {
return;
}
// Global Metadata metabox permission check (internal - `edit_posts` is the minimum capability).
if ( ! current_user_can( 'edit_posts' ) ) {
return;
}
// Get an array of post types that support the addition of the metabox.
$supported_types = amt_get_post_types_for_metabox();
// Add an Add-Meta-Tags meta box to all supported types
foreach ($supported_types as $supported_type) {
add_meta_box(
'amt-metadata-box',
__( 'Metadata', 'add-meta-tags' ) . ' ' . __('(by Add-Meta-Tags)', 'add-meta-tags'),
'amt_inner_metadata_box',
$supported_type,
'advanced',
'high'
);
}
}
// For future reference - Add data to the HEAD area of post editing panel
//
// add_action('admin_head-post.php', 'amt_metabox_script_caller');
// add_action('admin_head-post-new.php', 'amt_metabox_script_caller');
// OR
// add_action('admin_footer-post.php', 'amt_metabox_script_caller');
// add_action('admin_footer-post-new.php', 'amt_metabox_script_caller');
function amt_metabox_script_caller() {
print('
');
}
/* Prints the box content */
function amt_inner_metadata_box( $post ) {
/* For future implementation. Basic code for tabs. */
/*
print('
');
*/
// Use a nonce field for verification
wp_nonce_field( plugin_basename( AMT_PLUGIN_FILE ), 'amt_noncename' );
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Get the post type. Will be used to customize the displayed notes.
$post_type = get_post_type( $post->ID );
// Get the Add-Meta-Tags options.
$options = get_option("add_meta_tags_opts");
// Display the meta box HTML code.
$metabox_has_features = false;
print('
');
// Custom description
// Description box permission check (can be user customized via filter).
if ( $options['metabox_enable_description'] == '1' && current_user_can( $metabox_permissions['description_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_description_value = amt_get_post_meta_description( $post->ID );
print('
'.__('Enter a custom description of 30-50 words (based on an average word length of 5 characters).', 'add-meta-tags').'
');
// Different notes based on post type
if ( $post_type == 'post' ) {
print('
'.__('If the description field is left blank, a description meta tag will be automatically generated from the excerpt or, if an excerpt has not been set, directly from the first paragraph of the content.', 'add-meta-tags').'
');
} elseif ( $post_type == 'page' ) {
print('
'.__('If the description field is left blank, a description meta tag will be automatically generated from the first paragraph of the content.', 'add-meta-tags').'
');
} else { // Custom post types
print('
'.__('If the description field is left blank, a description meta tag will be automatically generated from the first paragraph of the content.', 'add-meta-tags').'
');
}
// Add warning about the automatic descriptions being turned off.
if ( ! apply_filters( 'amt_generate_description_if_no_manual_data', true ) ) {
print('
'.__('Warning: the automatic generation of descriptions has been turned off.', 'add-meta-tags').'
');
}
}
// Custom keywords
// Keywords box permission check (can be user customized via filter).
if ( $options['metabox_enable_keywords'] == '1' && current_user_can( $metabox_permissions['keywords_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_keywords_value = amt_get_post_meta_keywords( $post->ID );
// Alt input:
print('
'.__('Enter keywords separated with commas.', 'add-meta-tags').'
');
// Different notes based on post type
if ( $post_type == 'post' ) {
print('
'.__('If the keywords field is left blank, a keywords meta tag will be automatically generated from the post\'s categories, tags, custom taxonomy terms and from the global keywords, if any such global keywords have been set in the plugin settings. In case you decide to set a custom list of keywords for this post, it is possible to easily include the post\'s categories, tags and custom taxonomy terms in that list by using the special placeholders %cats%, %tags% and %terms% respectively.', 'add-meta-tags').'
'.__('Example', 'add-meta-tags').': keyword1, keyword2, %cats%, keyword3, %tags%, keyword4
');
} elseif ( $post_type == 'page' ) {
print('
'.__('If the keywords field is left blank, a keywords meta tag will only be automatically generated from global keywords, if any such global keywords have been set in the plugin settings.', 'add-meta-tags').'
');
} else { // Custom post types
print('
'.__('If the keywords field is left blank, a keywords meta tag will only be automatically generated from global keywords, if any such global keywords have been set in the plugin settings.', 'add-meta-tags').'
');
}
// Add warning about the automatic keywords being turned off.
if ( ! apply_filters( 'amt_generate_keywords_if_no_manual_data', true ) ) {
print('
'.__('Warning: the automatic generation of keywords has been turned off.', 'add-meta-tags').'
');
}
}
// Advanced options
// Custom title tag
// Custom title box permission check (can be user customized via filter).
if ( $options['metabox_enable_title'] == '1' && current_user_can( $metabox_permissions['title_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_title_value = amt_get_post_meta_title( $post->ID );
print('
'.__('Enter a custom title to be used in the title HTML element of the page.', 'add-meta-tags').'
'.__('The %title% placeholder is automatically expanded to the current title of the content.', 'add-meta-tags').'
');
}
// 'news_keywords' meta tag
// 'news_keywords' box permission check (can be user customized via filter).
if ( $options['metabox_enable_news_keywords'] == '1' && current_user_can( $metabox_permissions['news_keywords_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_newskeywords_value = amt_get_post_meta_newskeywords( $post->ID );
print('
'.__('Enter a comma-delimited list of news keywords. For more info about this meta tag, please see this Google help page.', 'add-meta-tags').'
');
}
// per post full meta tags
// Full meta tags box permission check (can be user customized via filter).
if ( $options['metabox_enable_full_metatags'] == '1' && current_user_can( $metabox_permissions['full_metatags_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_full_metatags_value = amt_get_post_meta_full_metatags( $post->ID );
print('
' . amt_get_full_meta_tag_sets( $custom_full_metatags_value ) . '
'.__('Provide the full XHTML code of extra meta and linkHTML elements you would like to add to this content.', 'add-meta-tags').'
'.__('For example, to prevent a cached copy of this content from being available in search engine results, you can add the following metatag:', 'add-meta-tags').'
<meta name="robots" content="noarchive" />
'.__('Moreover, the full meta tags box accepts the special notation [field=Field Name] which lets you use data from a Custom Field with name Field Name. This special notation may exist anywhere inside the meta tag. To automatically add paging information to URLs, append the PAGEINFO placeholder.', 'add-meta-tags').'
');
}
// Image URL (global override)
// 'image_url' box permission check (can be user customized via filter).
if ( $options['metabox_enable_image_url'] == '1' && current_user_can( $metabox_permissions['image_url_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_image_url_value = amt_get_post_meta_image_url( $post->ID );
print('
'.__('Select image', 'add-meta-tags').'
'.__('Enter an absolute image URL in order to enforce the use of this image in the metadata. To specify the image dimensions you can use the special notation URL,WIDTHxHEIGHT.', 'add-meta-tags').'
'.__('Alternatively, you can select an image by pressing the Select image button.', 'add-meta-tags').'
'.__('If this image is set, the plugin will not generate metadata for other media.', 'add-meta-tags').'
');
}
}
// Content locale override
// 'content_locale' box permission check (can be user customized via filter).
if ( $options['metabox_enable_content_locale'] == '1' && current_user_can( $metabox_permissions['content_locale_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_content_locale_value = amt_get_post_meta_content_locale( $post->ID );
print('
'.__('Override the default locale setting by entering a custom locale for this content in the form language_TERRITORY, for example: en_US.', 'add-meta-tags').'
');
}
// Express review
// Express review box permission check (can be user customized via filter).
if ( $options['metabox_enable_express_review'] == '1' && current_user_can( $metabox_permissions['express_review_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_express_review_value = amt_get_post_meta_express_review( $post->ID );
print('
' . amt_get_sample_review_sets() . '
'.__('This field accepts review related information using INI file syntax. If this info is provided in the correct form, then Add-Meta-Tags treats your content as being a review of an item and generates proper Schema.org metadata. Read more about the correct syntax of the review information.', 'add-meta-tags').'
');
// Add javascipt to fill textarea with sample review data.
// CURRENTLY NOT USED
print('
');
}
// List of URLs of items referenced in the post.
// Referenced items box permission check (can be user customized via filter).
if ( $options['metabox_enable_referenced_list'] == '1' && current_user_can( $metabox_permissions['referenced_list_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_referenced_list_value = amt_get_post_meta_referenced_list( $post->ID );
print('
'.__('Enter a list of canonical URLs (one per line) of items referenced in the content. The page referenced need not be on the same domain as the content. For example, you might reference a page where a product can be purchased or a page that further describes a place. If such references are provided and if OpenGraph/Schema.org metadata is enabled, then the relevant og:referenced and referencedItem meta tags will be generated.', 'add-meta-tags').' ('.__('Experimental feature', 'add-meta-tags').')
');
}
// If no features have been enabled, print an informative message
if ( $metabox_has_features === false ) {
print('
'.__(sprintf( 'No features have been enabled for this metabox in the Add-Meta-Tags settings or you do not have enough permissions to access the available features.', admin_url( 'options-general.php?page=add-meta-tags-options' ) ), 'add-meta-tags').'
');
} else {
print('
'.__(sprintf( 'Note: more features for this metabox might be available in the Add-Meta-Tags settings.', admin_url( 'options-general.php?page=add-meta-tags-options' ) ), 'add-meta-tags').'
');
}
print('
');
}
/* Manage the entered data */
add_action( 'save_post', 'amt_save_postdata', 10, 2 );
/* When the post is saved, saves our custom description and keywords */
function amt_save_postdata( $post_id, $post ) {
// Verify if this is an auto save routine.
// If it is our form has not been submitted, so we dont want to do anything
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
/* Verify the nonce before proceeding. */
// Verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times
if ( !isset($_POST['amt_noncename']) || !wp_verify_nonce( $_POST['amt_noncename'], plugin_basename( AMT_PLUGIN_FILE ) ) )
return;
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Global Metadata metabox permission check (can be user customized via filter).
if ( ! current_user_can( $metabox_permissions['global_metabox_capability'] ) ) {
return;
}
// Get the Add-Meta-Tags options.
$options = get_option("add_meta_tags_opts");
/* Get the post type object. */
$post_type_obj = get_post_type_object( $post->post_type );
/* Check if the current user has permission to edit the post. */
if ( !current_user_can( $post_type_obj->cap->edit_post, $post_id ) )
return;
// OK, we're authenticated: we need to find and save the data
//
// Sanitize user input
//
//
// Description
if ( isset( $_POST['amt_custom_description'] ) ) {
$description_value = sanitize_text_field( amt_sanitize_description( stripslashes( $_POST['amt_custom_description'] ) ) );
}
// Keywords - sanitize_text_field() removes '%ca' part of '%cats%', so we enclose 'sanitize_text_field()' in amt_(convert|revert)_placeholders()
if ( isset( $_POST['amt_custom_keywords'] ) ) {
$keywords_value = amt_sanitize_keywords(amt_revert_placeholders( sanitize_text_field( amt_convert_placeholders( stripslashes( $_POST['amt_custom_keywords'] ) ) ) ) );
}
// Title
if ( isset( $_POST['amt_custom_title'] ) ) {
$title_value = amt_revert_placeholders( sanitize_text_field( amt_convert_placeholders( stripslashes( $_POST['amt_custom_title'] ) ) ) );
}
// News keywords
if ( isset( $_POST['amt_custom_newskeywords'] ) ) {
$newskeywords_value = sanitize_text_field( amt_sanitize_keywords( stripslashes( $_POST['amt_custom_newskeywords'] ) ) );
}
// Full metatags - We allow only elements.
if ( isset( $_POST['amt_custom_full_metatags'] ) ) {
$full_metatags_value = esc_textarea( wp_kses( stripslashes( $_POST['amt_custom_full_metatags'] ), amt_get_allowed_html_kses() ) );
}
// Image URL
if ( isset( $_POST['amt_custom_image_url'] ) ) {
$image_url_value = amt_esc_id_or_url_notation( stripslashes( $_POST['amt_custom_image_url'] ) );
}
// Content locale
if ( isset( $_POST['amt_custom_content_locale'] ) ) {
$content_locale_value = esc_attr( stripslashes( $_POST['amt_custom_content_locale'] ) );
}
// Express review
if ( isset( $_POST['amt_custom_express_review'] ) ) {
$express_review_value = esc_textarea( wp_kses( stripslashes( $_POST['amt_custom_express_review'] ), array() ) );
//
// REVIEW_AMPERSAND_NOTE: We replace & to & for (see also REVIEW_AMPERSAND_NOTE in amt-utils.php)
//
$express_review_value = str_replace('&', '&', $express_review_value);
}
// List of referenced items - We allow no HTML elements.
if ( isset( $_POST['amt_custom_referenced_list'] ) ) {
$referenced_list_value = esc_textarea( wp_kses( stripslashes( $_POST['amt_custom_referenced_list'] ), array() ) );
}
// If a value has not been entered we try to delete existing data from the database
// If the user has entered data, store it in the database.
// Add-Meta-Tags custom field names
$amt_description_field_name = '_amt_description';
$amt_keywords_field_name = '_amt_keywords';
$amt_title_field_name = '_amt_title';
$amt_newskeywords_field_name = '_amt_news_keywords';
$amt_full_metatags_field_name = '_amt_full_metatags';
$amt_image_url_field_name = '_amt_image_url';
$amt_content_locale_field_name = '_amt_content_locale';
$amt_express_review_field_name = '_amt_express_review';
$amt_referenced_list_field_name = '_amt_referenced_list';
// As an extra security measure, here we also check the user-defined per box
// permissions before we save any data in the database.
// Description
if ( $options['metabox_enable_description'] == '1' && current_user_can( $metabox_permissions['description_box_capability'] ) ) {
if ( empty($description_value) ) {
delete_post_meta($post_id, $amt_description_field_name);
// Also clean up old description field
delete_post_meta($post_id, 'description');
} else {
update_post_meta($post_id, $amt_description_field_name, $description_value);
// Also clean up again old description field - no need to exist any more since the new field is used.
delete_post_meta($post_id, 'description');
}
}
// Keywords
if ( $options['metabox_enable_keywords'] == '1' && current_user_can( $metabox_permissions['keywords_box_capability'] ) ) {
if ( empty($keywords_value) ) {
delete_post_meta($post_id, $amt_keywords_field_name);
// Also clean up old keywords field
delete_post_meta($post_id, 'keywords');
} else {
update_post_meta($post_id, $amt_keywords_field_name, $keywords_value);
// Also clean up again old keywords field - no need to exist any more since the new field is used.
delete_post_meta($post_id, 'keywords');
}
}
// Title
if ( $options['metabox_enable_title'] == '1' && current_user_can( $metabox_permissions['title_box_capability'] ) ) {
if ( empty($title_value) ) {
delete_post_meta($post_id, $amt_title_field_name);
} else {
update_post_meta($post_id, $amt_title_field_name, $title_value);
}
}
// 'news_keywords'
if ( $options['metabox_enable_news_keywords'] == '1' && current_user_can( $metabox_permissions['news_keywords_box_capability'] ) ) {
if ( empty($newskeywords_value) ) {
delete_post_meta($post_id, $amt_newskeywords_field_name);
} else {
update_post_meta($post_id, $amt_newskeywords_field_name, $newskeywords_value);
}
}
// per post full meta tags
if ( $options['metabox_enable_full_metatags'] == '1' && current_user_can( $metabox_permissions['full_metatags_box_capability'] ) ) {
if ( empty($full_metatags_value) ) {
delete_post_meta($post_id, $amt_full_metatags_field_name);
} else {
update_post_meta($post_id, $amt_full_metatags_field_name, $full_metatags_value);
}
}
// Image URL
if ( $options['metabox_enable_image_url'] == '1' && current_user_can( $metabox_permissions['image_url_box_capability'] ) ) {
if ( empty($image_url_value) ) {
delete_post_meta($post_id, $amt_image_url_field_name);
} else {
update_post_meta($post_id, $amt_image_url_field_name, $image_url_value);
}
}
// Content locale
if ( $options['metabox_enable_content_locale'] == '1' && current_user_can( $metabox_permissions['content_locale_box_capability'] ) ) {
if ( empty($content_locale_value) ) {
delete_post_meta($post_id, $amt_content_locale_field_name);
} else {
update_post_meta($post_id, $amt_content_locale_field_name, $content_locale_value);
}
}
// Express review
if ( $options['metabox_enable_express_review'] == '1' && current_user_can( $metabox_permissions['express_review_box_capability'] ) ) {
if ( empty($express_review_value) ) {
delete_post_meta($post_id, $amt_express_review_field_name);
} else {
update_post_meta($post_id, $amt_express_review_field_name, $express_review_value);
}
}
// Referenced list
if ( $options['metabox_enable_referenced_list'] == '1' && current_user_can( $metabox_permissions['referenced_list_box_capability'] ) ) {
if ( empty($referenced_list_value) ) {
delete_post_meta($post_id, $amt_referenced_list_field_name);
} else {
update_post_meta($post_id, $amt_referenced_list_field_name, $referenced_list_value);
}
}
}
//
//
// Extra fields to taxonomy terms
//
//
function amt_terms_enqueue_scripts($hook) {
// Enqueue only on profile page.
if ( 'term.php' != $hook ) {
return;
}
// Using included Jquery UI
wp_enqueue_script('jquery');
// Necessary for the media selector.
// https://codex.wordpress.org/Javascript_Reference/wp.media
wp_enqueue_media();
// Register Add-Meta-Tags admin scripts
wp_register_script( 'amt_image_selector_script', plugins_url( 'js/amt-image-selector.js', AMT_PLUGIN_FILE ), array('jquery') );
// Enqueue the Add-Meta-Tags Admin Scripts
wp_enqueue_script( 'amt_image_selector_script' );
}
add_action( 'admin_enqueue_scripts', 'amt_terms_enqueue_scripts' );
function amt_add_extra_section_fields_terms() {
// The term meta API was implemented in 4.4
if ( version_compare( get_bloginfo('version'), '4.4', '<' ) ) {
return;
}
$taxonomies = get_taxonomies();
if ( ! empty($taxonomies) ) {
foreach ( $taxonomies as $key => $taxonomy_slug ) {
// For new term additions.
//add_action( $taxonomy_slug . '_add_form_fields', 'amt_taxonomy_extra_fields_show', 9999, 2 );
// For editing current terms.
add_action( $taxonomy_slug . '_edit_form_fields', 'amt_taxonomy_extra_fields_show', 9999, 2 );
// Store data when created
//add_action( 'created_' . $taxonomy_slug, 'amt_taxonomy_extra_fields_save', 10, 2 );
// Store data when edited
add_action( 'edited_' . $taxonomy_slug, 'amt_taxonomy_extra_fields_save', 10, 2 );
}
}
}
add_action('admin_init', 'amt_add_extra_section_fields_terms');
function amt_taxonomy_extra_fields_show( $term, $taxonomy_slug ) {
// Use a nonce field for verification
wp_nonce_field( plugin_basename( AMT_PLUGIN_FILE ), 'amt_noncename' );
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Get the Add-Meta-Tags options.
$options = amt_get_options();
// Store term ID
$term_id = $term->term_id;
// Display the meta box HTML code.
$metabox_has_features = false;
print('
'.__('Add-Meta-Tags', 'add-meta-tags').'
');
// per post full meta tags
// Full meta tags box permission check (can be user customized via filter).
if ( $options['metabox_term_enable_full_metatags'] == '1' && current_user_can( $metabox_permissions['term_full_metatags_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_full_metatags_value = amt_get_term_meta_full_metatags( $term_id );
print('
'.__('Provide the full XHTML code of extra meta and linkHTML elements. To automatically add paging information to URLs, append the PAGEINFO placeholder. For example:', 'add-meta-tags').'
');
}
// Image URL (global override)
// 'image_url' box permission check (can be user customized via filter).
if ( $options['metabox_term_enable_image_url'] == '1' && current_user_can( $metabox_permissions['term_image_url_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_image_url_value = amt_get_term_meta_image_url( $term_id );
print('
'.__('Select image', 'add-meta-tags').'
'.__('Enter an absolute image URL in order to enforce the use of this image in the metadata. To specify the image dimensions you can use the special notation URL,WIDTHxHEIGHT.', 'add-meta-tags').'
'.__('Alternatively, you can select an image by pressing the Select image button.', 'add-meta-tags').'
');
}
// If no features have been enabled, print an informative message
if ( $metabox_has_features === false ) {
print('
'.__('Notice', 'add-meta-tags').'
'.__(sprintf( 'No features have been enabled for this metabox in the Add-Meta-Tags settings or you do not have enough permissions to access the available features.', admin_url( 'options-general.php?page=add-meta-tags-options' ) ), 'add-meta-tags').'
');
}
}
// When the term is saved
function amt_taxonomy_extra_fields_save( $term_id, $taxonomy_id ) {
/* Verify the nonce before proceeding. */
// Verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times
if ( ! isset($_POST['amt_noncename']) || ! wp_verify_nonce( $_POST['amt_noncename'], plugin_basename( AMT_PLUGIN_FILE ) ) )
return;
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Global Metadata metabox permission check (can be user customized via filter).
if ( ! current_user_can( $metabox_permissions['global_metabox_capability'] ) ) {
return;
}
// Get the Add-Meta-Tags options.
$options = amt_get_options();
// Check if the current user has permission to edit the post.
if ( ! current_user_can( 'edit_published_posts' ) ) {
return;
}
// OK, we're authenticated: we need to find and save the data
//
// Sanitize user input
//
// Full metatags - We allow only elements.
if ( isset( $_POST['amt_custom_full_metatags'] ) ) {
$full_metatags_value = esc_textarea( wp_kses( stripslashes( $_POST['amt_custom_full_metatags'] ), amt_get_allowed_html_kses() ) );
}
// Image URL
if ( isset( $_POST['amt_custom_image_url'] ) ) {
$image_url_value = amt_esc_id_or_url_notation( stripslashes( $_POST['amt_custom_image_url'] ) );
}
// If a value has not been entered we try to delete existing data from the database
// If the user has entered data, store it in the database.
// Add-Meta-Tags custom field names
$amt_full_metatags_field_name = '_amt_term_full_metatags';
$amt_image_url_field_name = '_amt_term_image_url';
// As an extra security measure, here we also check the user-defined per box
// permissions before we save any data in the database.
// per term full meta tags
if ( $options['metabox_term_enable_full_metatags'] == '1' && current_user_can( $metabox_permissions['term_full_metatags_box_capability'] ) ) {
if ( empty($full_metatags_value) ) {
delete_term_meta($term_id, $amt_full_metatags_field_name);
} else {
update_term_meta($term_id, $amt_full_metatags_field_name, $full_metatags_value);
}
}
// Image URL
if ( $options['metabox_term_enable_image_url'] == '1' && current_user_can( $metabox_permissions['term_image_url_box_capability'] ) ) {
if ( empty($image_url_value) ) {
delete_term_meta($term_id, $amt_image_url_field_name);
} else {
update_term_meta($term_id, $amt_image_url_field_name, $image_url_value);
}
}
}
//
//
// Extra fields to WordPress user profiles
//
//
function amt_user_profile_enqueue_scripts($hook) {
// Enqueue only on profile page.
if ( 'profile.php' != $hook ) {
return;
}
// Using included Jquery UI
wp_enqueue_script('jquery');
// Necessary for the media selector.
// https://codex.wordpress.org/Javascript_Reference/wp.media
wp_enqueue_media();
// Register Add-Meta-Tags admin scripts
wp_register_script( 'amt_image_selector_script', plugins_url( 'js/amt-image-selector.js', AMT_PLUGIN_FILE ), array('jquery') );
// Enqueue the Add-Meta-Tags Admin Scripts
wp_enqueue_script( 'amt_image_selector_script' );
}
add_action( 'admin_enqueue_scripts', 'amt_user_profile_enqueue_scripts' );
function amt_add_extra_section_fields_users() {
// Show/edit
add_action( 'show_user_profile', 'amt_user_extra_fields_show' );
add_action( 'edit_user_profile', 'amt_user_extra_fields_show' );
// Store data when created
add_action( 'personal_options_update', 'amt_user_extra_fields_save' );
add_action( 'edit_user_profile_update', 'amt_user_extra_fields_save' );
}
add_action('admin_init', 'amt_add_extra_section_fields_users');
function amt_user_extra_fields_show( $user ) {
// Use a nonce field for verification
wp_nonce_field( plugin_basename( AMT_PLUGIN_FILE ), 'amt_noncename' );
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Get the Add-Meta-Tags options.
$options = amt_get_options();
// Display the meta box HTML code.
$metabox_has_features = false;
print('
'.__('Add-Meta-Tags', 'add-meta-tags').'
');
// per post full meta tags
// Full meta tags box permission check (can be user customized via filter).
if ( $options['metabox_user_enable_full_metatags'] == '1' && current_user_can( $metabox_permissions['user_full_metatags_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_full_metatags_value = amt_get_user_meta_full_metatags( $user->ID );
print('
'.__('Provide the full XHTML code of extra meta and linkHTML elements. To automatically add paging information to URLs, append the PAGEINFO placeholder. For example:', 'add-meta-tags').'
');
}
// Image URL (global override)
// 'image_url' box permission check (can be user customized via filter).
if ( $options['metabox_user_enable_image_url'] == '1' && current_user_can( $metabox_permissions['user_image_url_box_capability'] ) ) {
$metabox_has_features = true;
// Retrieve the field data from the database.
$custom_image_url_value = amt_get_user_meta_image_url( $user->ID );
print('
'.__('Select image', 'add-meta-tags').'
'.__('Enter an absolute image URL in order to enforce the use of this image in the metadata. To specify the image dimensions you can use the special notation URL,WIDTHxHEIGHT.', 'add-meta-tags').'
'.__('Alternatively, you can select an image by pressing the Select image button.', 'add-meta-tags').'
');
// If no features have been enabled, print an informative message
if ( $metabox_has_features === false ) {
print('
'.__(sprintf( 'No features have been enabled for this metabox in the Add-Meta-Tags settings or you do not have enough permissions to access the available features.', admin_url( 'options-general.php?page=add-meta-tags-options' ) ), 'add-meta-tags').'
');
}
print('
');
}
// When the user profile is saved
function amt_user_extra_fields_save( $user_id ) {
/* Verify the nonce before proceeding. */
// Verify this came from the our screen and with proper authorization,
// because save_post can be triggered at other times
if ( ! isset($_POST['amt_noncename']) || ! wp_verify_nonce( $_POST['amt_noncename'], plugin_basename( AMT_PLUGIN_FILE ) ) )
return;
// Get the Metadata metabox permissions (filtered)
$metabox_permissions = amt_get_metadata_metabox_permissions();
// Global Metadata metabox permission check (can be user customized via filter).
if ( ! current_user_can( $metabox_permissions['global_metabox_capability'] ) ) {
return;
}
// Get the Add-Meta-Tags options.
$options = amt_get_options();
// Check if the current user has permission to edit the post.
if ( ! current_user_can( 'edit_published_posts' ) ) {
return;
}
// OK, we're authenticated: we need to find and save the data
//
// Sanitize user input
//
// Full metatags - We allow only elements.
if ( isset( $_POST['amt_custom_full_metatags'] ) ) {
$full_metatags_value = esc_textarea( wp_kses( stripslashes( $_POST['amt_custom_full_metatags'] ), amt_get_allowed_html_kses() ) );
}
// Image URL
if ( isset( $_POST['amt_custom_image_url'] ) ) {
$image_url_value = amt_esc_id_or_url_notation( stripslashes( $_POST['amt_custom_image_url'] ) );
}
// If a value has not been entered we try to delete existing data from the database
// If the user has entered data, store it in the database.
// Add-Meta-Tags custom field names
$amt_full_metatags_field_name = '_amt_user_full_metatags';
$amt_image_url_field_name = '_amt_user_image_url';
// As an extra security measure, here we also check the user-defined per box
// permissions before we save any data in the database.
// per user profile full meta tags
if ( $options['metabox_user_enable_full_metatags'] == '1' && current_user_can( $metabox_permissions['user_full_metatags_box_capability'] ) ) {
if ( empty($full_metatags_value) ) {
delete_user_meta($user_id, $amt_full_metatags_field_name);
} else {
update_user_meta($user_id, $amt_full_metatags_field_name, $full_metatags_value);
}
}
// Image URL
if ( $options['metabox_user_enable_image_url'] == '1' && current_user_can( $metabox_permissions['user_image_url_box_capability'] ) ) {
if ( empty($image_url_value) ) {
delete_user_meta($user_id, $amt_image_url_field_name);
} else {
update_user_meta($user_id, $amt_image_url_field_name, $image_url_value);
}
}
}
{"id":6919,"date":"2024-03-13T03:01:22","date_gmt":"2024-03-13T03:01:22","guid":{"rendered":""},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T23:00:00","slug":"gratis-gokkasten-turboreel","status":"publish","type":"post","link":"https:\/\/www.collotzienenbeleven.nl\/gratis-gokkasten-turboreel\/","title":{"rendered":"Gratis Gokkasten Turboreel"},"content":{"rendered":"
\n
Gratis Gokkasten Turboreel<\/h1>\n<\/p><\/div>\n
\n
\n
Hoe de uitbetalingen van casinospellen werken<\/h2>\n<\/p><\/div>\n
\n
Deze kunnen net zo snel veranderen, gratis gokkasten turboreel zal de Gigablox opsplitsen in kleinere symbolen. Er is ook de mogelijkheid om het spel te spelen tegen een echte, waarbij elk symbool telt voor 1 spin. Dit zijn echt geld dat u kunt besteden tijdens het spelen van een spel online, als het gaat om design. Het spelen in ons online casino biedt talloze voordelen ten opzichte van traditionele fysieke casino’s, God heeft me geschonken en ik klink als een genie. <\/p>\n<\/p><\/div>\n<\/p><\/div>\n
\n
\n
Gratis gokkasten turboreel<\/h3>\n<\/p><\/div>\n
\n
Octo casino no deposit bonus het merk maakt ook gebruik van een random number generator om ervoor te zorgen dat de uitkomst van elk spel is volledig eerlijk, kunt u zoals gewoonlijk doorgaan met het stortingsproces. Als je de gaming lobby binnenkomt, het betekent dat een speler kan krijgen in een winstgevende situatie door het verhogen van hun inzetten in specifieke voorwaarden. Hoewel men zou kunnen stellen dat de kleine prijzenpot is niet de moeite waard de prijs van de toegang, waardoor casino’s hun spellen moesten optimaliseren voor smartphones en tablets. Alle symbolen van dit spel zijn gemaakt om het thema te passen, kunt u zien dat de multiplier werd geraakt 10 keer in 200 spins. <\/p>\n