| Server IP : 194.30.32.123 / Your IP : 216.73.216.89 Web Server : Apache System : Linux 4f6650a08421 5.10.0-44-amd64 #1 SMP Debian 5.10.257-1 (2026-05-27) x86_64 User : ftpbegirale ( 1001) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,curl_multi_exec,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /expert/htwebs/www.begirale.com/public/wp-content/plugins/types/embedded/includes/ |
Upload File : |
<?php
/*
* Footer credit
*/
if (file_exists(WPCF_EMBEDDED_INC_ABSPATH . '/src.php')) {
include_once WPCF_EMBEDDED_INC_ABSPATH . '/src.php';
}
if (isset($_GET['page']) && in_array($_GET['page'],
array('wpcf', 'wpcf-ctt', 'wpcf-import-export', 'wpcf-custom-fields-control', 'wpcf-custom-settings'))) {
add_action('wpcf_admin_page_init', 'wpcf_footer_credit_message_init');
}
if (!is_admin()) {
wpcf_footer_credits_init();
}
/**
* Init function.
*/
function wpcf_footer_credits_init() {
$template = get_template();
$option = get_option('wpcf_footer_credit', false);
if (!empty($option['active'])) {
if (in_array($template, array('twentyten', 'twentyeleven'))) {
add_action($template . '_credits', 'wpcf_footer_credit_render');
} else if ($template == 'canvas') {
add_action('woo_footer_right_before', 'wpcf_footer_credit_render');
} else if ($template == 'genesis') {
add_action('genesis_footer', 'wpcf_footer_credit_render', 10);
} else if ($template == 'thesis_18') {
add_action('thesis_hook_footer', 'wpcf_footer_credit_render', 1);
} else if ($template == 'headway') {
add_action('headway_footer_open', 'wpcf_footer_credit_render', 11);
} else {
add_action('wp_footer', 'wpcf_footer_credit_render');
}
}
}
/**
* Default credits.
*
* @return string[]
*
* @fixme this is ancient, might need a review
*/
function wpcf_footer_credit_defaults() {
return array(
sprintf(__("Functionality enhanced using %sWordPress Post Fields%s", 'wpcf'),
'<a href="http://wp-types.com/documentation/user-guides/using-custom-fields/" target="_blank">',
' »</a>'),
sprintf(__("Functionality enhanced using %sWordPress Post Types%s", 'wpcf'),
'<a href="http://wp-types.com/documentation/user-guides/create-a-custom-post-type/" target="_blank">',
' »</a>'),
sprintf(__("Functionality enhanced using %sWordPress Taxonomy%s", 'wpcf'),
'<a href="http://wp-types.com/documentation/user-guides/create-custom-taxonomies/" target="_blank">',
' »</a>'),
);
}
/**
* Renders credits in footer.
*/
function wpcf_footer_credit_render() {
$option = get_option('wpcf_footer_credit', false);
if (!empty($option['active'])) {
// Set message
$data = wpcf_footer_credit_defaults();
if (isset($option['message']) && isset($data[$option['message']])) {
$message = $data[$option['message']];
} else {
$message = $data[0];
}
$template = get_template();
if ($template == 'canvas') {
echo '<p style="margin-bottom:10px;">' . $message . '</p>';
} else if ($template == 'genesis') {
echo '<div id="types-credits" class="creds"><p>' . $message . '</p></div>';
} else if ($template == 'thesis_18') {
echo '<p>' . $message . '</p>';
} else if ($template == 'headway') {
echo '<p style="float:none;" class="footer-left footer-headway-link footer-link">' . $message . '</p>';
} else if ($template == 'twentyeleven') {
echo $message . '<br />';
} else if ($template == 'twentyten') {
echo str_replace('<a ', '<a style="background:none;" ', $message) . '<br />';
} else {
echo '<div id="types-credits" style="margin: 10px 0 10px 0;width:95%;text-align:center;font-size:0.9em;">' . $message . '</div>';
}
}
}
/**
* Support message init.
*/
function wpcf_footer_credit_message_init() {
add_action('admin_notices', 'wpcf_footer_credit_message');
}
/**
* Support message.
*/
function wpcf_footer_credit_message() {
$dismissed = get_option('wpcf_dismissed_messages', array());
if (in_array('footer_credit_support_message', $dismissed)) {
return false;
}
$option = get_option('wpcf_footer_credit', false);
if (empty($option['active'])) {
$message = __('You too can support Types! Would you like to add a small credit link, saying that you\'re using Types for custom fields or post types?', 'wpcf')
. '<br /><br />'
. '<a onclick="jQuery(this).parent().parent().fadeOut();" class="wpcf-ajax-link button-primary" href="'
. admin_url('admin-ajax.php?action=wpcf_ajax&wpcf_action=footer_credit_activate_message&_wpnonce='
. wp_create_nonce('footer_credit_activate_message')) . '" class="button-primary">' . __('Yes', 'wpcf') . '</a>'
. " <a onclick=\"jQuery(this).parent().parent().fadeOut();\" class=\"wpcf-ajax-link button-secondary\" href=\""
. admin_url('admin-ajax.php?action=wpcf_ajax&wpcf_action=dismiss_message&id='
. 'footer_credit_support_message' . '&_wpnonce=' . wp_create_nonce('dismiss_message')) . "\">"
. __('No, thanks', 'wpcf') . '</a>';
echo '<div class="message updated"><p>' . $message . '</p></div>';
}
}