本文整理汇总了PHP中EDD_FES函数的典型用法代码示例。如果您正苦于以下问题:PHP EDD_FES函数的具体用法?PHP EDD_FES怎么用?PHP EDD_FES使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EDD_FES函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fes_secure_logout
public function fes_secure_logout()
{
$base_url = get_permalink(EDD_FES()->helper->get_option('fes-vendor-dashboard-page', false));
$base_url = add_query_arg(array('view' => 'login', 'task' => false), $base_url);
wp_redirect($base_url);
exit;
}
示例2: kjm_change_vendor_delete_product_redirect
/**
* Plugin Name: Change Vendor Delete Product Redirect
* Author: Kyle Maurer
*/
function kjm_change_vendor_delete_product_redirect()
{
$redirect_to = get_permalink(EDD_FES()->helper->get_option('fes-vendor-dashboard-page', false));
$redirect_to = add_query_arg(array('task' => 'products'), $redirect_to);
wp_redirect($redirect_to);
exit;
}
示例3: collaboration_locate_template
public function collaboration_locate_template($template_names, $load = false, $require_once = true)
{
// No file found yet
$located = false;
// Try to find a template file
foreach ((array) $template_names as $template_name) {
// Continue if template is empty
if (empty($template_name)) {
continue;
}
// Trim off any slashes from the template name
$template_name = ltrim($template_name, '/');
// Check child theme first
if (file_exists(trailingslashit(get_stylesheet_directory()) . 'collaboration_templates/' . $template_name)) {
$located = trailingslashit(get_stylesheet_directory()) . 'collaboration_templates/' . $template_name;
break;
// Check parent theme next
} elseif (file_exists(trailingslashit(get_template_directory()) . 'collaboration_templates/' . $template_name)) {
$located = trailingslashit(get_template_directory()) . 'collaboration_templates/' . $template_name;
break;
// Check theme compatibility last
} elseif (file_exists(trailingslashit(EDD_FES()->templates->collaboration_get_templates_dir()) . $template_name)) {
$located = trailingslashit(EDD_FES()->templates->collaboration_get_templates_dir()) . $template_name;
break;
}
}
if (true == $load && !empty($located)) {
load_template($located, $require_once);
}
return $located;
}
示例4: marketify_edd_fes_vendor_dashboard_menu
/**
* FES Vendor Dashboard Menu
*
* @since Marketify 1.0
*
* @param array $menu
* @return array $menu
*/
function marketify_edd_fes_vendor_dashboard_menu($menu)
{
if (EDD_FES()->integrations->is_commissions_active()) {
$menu['earnings']['icon'] = 'graph';
}
$menu['home']['icon'] = 'house';
$menu['orders']['icon'] = 'ticket';
$menu['logout']['icon'] = 'logout';
return $menu;
}
示例5: enqueue_styles
public function enqueue_styles($override = false)
{
if (is_admin()) {
return;
}
global $post;
if (is_page(EDD_FES()->helper->get_option('fes-vendor-dashboard-page', false)) || $override) {
// FES outputs minified scripts by default on the frontend. To load full versions, hook into this and return empty string.
$minify = apply_filters('fes_output_minified_versions', '.min');
if (EDD_FES()->helper->get_option('fes-use-css', true)) {
wp_enqueue_style('fes-css', fes_plugin_url . 'assets/css/frontend' . $minify . '.css');
}
wp_enqueue_style('jquery-ui', fes_plugin_url . 'assets/css/jquery-ui-1.9.1.custom.css');
}
}
示例6: save_meta
function save_meta($post_id, $post)
{
if (!isset($_POST['fes_cf_update']) || !isset($_POST['post_ID'])) {
return;
}
if (!wp_verify_nonce($_POST['fes_cf_update'], 'fes_cf_update')) {
return;
}
// Is the user allowed to edit the post or page?
if (!current_user_can('edit_post', $_POST['post_ID'])) {
return $_POST['post_ID'];
}
list($post_vars, $tax_vars, $meta_vars) = self::get_input_fields($_POST['fes_cf_form_id']);
EDD_FES()->forms->update_post_meta($meta_vars, $_POST['post_ID']);
do_action('fes_save_meta_download', $_POST['post_ID']);
}
示例7: checkout_body_class
/**
* Add body class by filter
*
* @since 1.0
*/
function checkout_body_class($classes)
{
/**
* Add body class to vendor dashboard pages
*/
if (function_exists('EDD_FES') && is_page(EDD_FES()->helper->get_option('fes-vendor-dashboard-page', false))) {
$classes[] = 'vendor-dashboard';
if (!is_user_logged_in()) {
$classes[] = 'not-signed-in';
}
$task = '';
if (isset($_GET['task']) && !empty($_GET['task'])) {
$task = $_GET['task'];
}
switch ($task) {
case 'new-product':
$classes[] = 'product-management';
break;
case 'edit-product':
$classes[] = 'product-management';
break;
case 'earnings':
$classes[] = 'vendor-earnings';
break;
case 'products':
$classes[] = 'product-list';
break;
}
}
/**
* Add body class to vendor pages
*/
$vendor = get_query_var('vendor');
if (!empty($vendor)) {
$classes[] = 'vendor-archive';
}
return $classes;
}
示例8: save_default_values
private function save_default_values($slug, $page_id)
{
switch ($slug) {
case 'fes-login-form':
$login = array(1 => array('input_type' => 'text', 'template' => 'user_login', 'required' => 'yes', 'label' => __('Username', 'edd_fes'), 'name' => 'user_login', 'is_meta' => 'yes', 'size' => 40, 'help' => '', 'css' => '', 'placeholder' => '', 'default' => ''), 2 => array('input_type' => 'password', 'template' => 'password', 'required' => 'yes', 'label' => __('Password', 'edd_fes'), 'name' => 'password', 'is_meta' => 'yes', 'size' => '40', 'min_length' => '6', 'repeat_pass' => 'no', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => ''), 3 => array('input_type' => 'radio', 'template' => 'radio_field', 'required' => 'yes', 'label' => __('Login as a', 'edd_fes'), 'is_meta' => 'no', 'name' => 'fes_login_radio_button', 'css' => 'fes_login_radio_button', 'selected' => 'Vendor', 'options' => array(EDD_FES()->vendors->get_vendor_constant_name($plural = false, $uppercase = true), __('Customer', 'edd_fes')), 'help' => '', 'placeholder' => '', 'default' => ''), 4 => array('input_type' => 'recaptcha', 'template' => 'recaptcha', 'label' => ''));
update_post_meta($page_id, 'fes-form', $login);
break;
case 'fes-profile-form':
$login = array(0 => array('input_type' => 'text', 'template' => 'text_field', 'required' => 'yes', 'label' => 'Name of Store', 'name' => 'name_of_store', 'is_meta' => 'yes', 'help' => 'What would you like your store to be called?', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 1 => array('input_type' => 'email', 'template' => 'email_address', 'required' => 'yes', 'label' => 'Email to use for Contact Form', 'name' => 'email_to_use_for_contact_form', 'is_meta' => 'yes', 'help' => 'This email, if filled in, will be used for the vendor contact forms. If it is not filled in, the one from your user profile will be used.', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'));
update_post_meta($page_id, 'fes-form', $login);
break;
case 'fes-registration-form':
$register = array(1 => array('input_type' => 'text', 'template' => 'first_name', 'required' => 'yes', 'label' => 'First Name', 'name' => 'first_name', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 2 => array('input_type' => 'text', 'template' => 'last_name', 'required' => 'yes', 'label' => 'Last Name', 'name' => 'last_name', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 3 => array('input_type' => 'email', 'template' => 'user_email', 'required' => 'yes', 'label' => 'Email', 'name' => 'user_email', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 4 => array('input_type' => 'text', 'template' => 'user_login', 'required' => 'yes', 'label' => 'Username', 'name' => 'user_login', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 5 => array('input_type' => 'password', 'template' => 'password', 'required' => 'yes', 'label' => 'Password', 'name' => 'password', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40', 'min_length' => '6', 'repeat_pass' => 'no'), 6 => array('input_type' => 'text', 'template' => 'display_name', 'required' => 'yes', 'label' => 'Display Name', 'name' => 'display_name', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'));
update_post_meta($page_id, 'fes-form', $register);
break;
case 'fes-vendor-contact-form':
$contact = array(1 => array('input_type' => 'text', 'template' => 'first_name', 'required' => 'yes', 'label' => __('First Name', 'edd_fes'), 'name' => 'first_name', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 2 => array('input_type' => 'text', 'template' => 'last_name', 'required' => 'yes', 'label' => __('Last Name', 'edd_fes'), 'name' => 'last_name', 'is_meta' => 'yes', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 3 => array('input_type' => 'email', 'template' => 'user_email', 'required' => 'yes', 'label' => __('Email', 'edd_fes'), 'name' => 'user_email', 'is_meta' => 'no', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 4 => array('input_type' => 'text', 'template' => 'text', 'required' => 'yes', 'label' => __('Subject', 'edd_fes'), 'name' => 'subject', 'is_meta' => 'no', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 5 => array('input_type' => 'textarea', 'template' => 'textarea', 'required' => 'yes', 'label' => __('Message', 'edd_fes'), 'name' => 'message', 'is_meta' => 'no', 'help' => '', 'css' => '', 'placeholder' => '', 'default' => '', 'size' => '40'), 6 => array('input_type' => 'recaptcha', 'template' => 'recaptcha', 'label' => ''));
update_post_meta($page_id, 'fes-form', $contact);
break;
default:
break;
}
}
示例9: get_bulk_actions
function get_bulk_actions()
{
$actions = array('approve_vendor' => __('Approve', 'edd_fes') . ' ' . EDD_FES()->vendors->get_vendor_constant_name($plural = true, $uppercase = true), 'decline_vendor' => __('Decline', 'edd_fes') . ' ' . EDD_FES()->vendors->get_vendor_constant_name($plural = true, $uppercase = true), 'revoke_vendor' => __('Revoke', 'edd_fes') . ' ' . EDD_FES()->vendors->get_vendor_constant_name($plural = true, $uppercase = true), 'suspend_vendor' => __('Suspend', 'edd_fes') . ' ' . EDD_FES()->vendors->get_vendor_constant_name($plural = true, $uppercase = true), 'unsuspend_vendor' => __('Unsuspend', 'edd_fes') . ' ' . EDD_FES()->vendors->get_vendor_constant_name($plural = true, $uppercase = true));
return $actions;
}
示例10: fes_forms_edit_form_area
function fes_forms_edit_form_area()
{
global $post, $pagenow;
if (get_the_ID() == EDD_FES()->helper->get_option('fes-submission-form', false)) {
$form = __('Your submission form has no fields', 'edd_fes');
} else {
if (get_the_ID() == EDD_FES()->helper->get_option('fes-profile-form', false)) {
$form = __('Your profile form has no fields', 'edd_fes');
} else {
$form = __('Your registration form has no fields', 'edd_fes');
}
}
$form = apply_filters('fes_edit_form_area_no_fields', $form, get_the_ID());
$form_inputs = get_post_meta($post->ID, 'fes-form', true);
?>
<input type="hidden" name="fes-form-editor" id="fes-form-editor" value="<?php
echo wp_create_nonce("fes-form-editor");
?>
" />
<div style="margin-bottom: 10px">
<button class="button fes-collapse"><?php
_e('Toggle All Fields Open/Close', 'edd_fes');
?>
</button>
</div>
<?php
if (empty($form_inputs)) {
?>
<div class="fes-updated">
<p><?php
echo $form;
?>
</p>
</div>
<?php
}
?>
<ul id="fes-form-editor" class="fes-form-editor unstyled">
<?php
if ($form_inputs) {
$count = 0;
foreach ($form_inputs as $order => $input_field) {
$name = ucwords(str_replace('_', ' ', $input_field['template']));
$is_custom = apply_filters('fes_formbuilder_custom_field', false, $input_field);
if ($is_custom) {
$name = $input_field['input_type'];
do_action('fes_admin_field_' . $name, $count, $name, $input_field);
$count++;
} else {
if ($input_field['input_type'] == 'really_simple_captcha' || $input_field['input_type'] == 'google_map') {
continue;
} else {
if ($input_field['template'] == 'taxonomy') {
FES_Formbuilder_Templates::$input_field['template']($count, $name, $input_field['name'], $input_field);
$count++;
} else {
FES_Formbuilder_Templates::$input_field['template']($count, $name, $input_field);
$count++;
}
}
}
}
}
?>
</ul>
<?php
}
示例11: process_vendor_email_submission
public function process_vendor_email_submission($data)
{
if (!current_user_can('edit_shop_payments') && !EDD_FES()->vendors->vendor_is_vendor(get_current_user_id())) {
wp_die(__('You do not have permission to submit email updates', 'edd-fes-product-updates'), __('Error', 'edd-fes-product-updates'), array('response' => 401));
}
if (!wp_verify_nonce($data['edd_fes_create_email'], 'edd_fes_create_email')) {
wp_die(__('Nonce verification has failed', 'edd-fes-product-updates'), __('Error', 'edd-fes-product-updates'), array('response' => 401));
}
if (empty($data['fes-email-products'])) {
wp_die(__('Please select at least one product', 'edd-fes-product-updates'), __('Error', 'edd-fes-product-updates'), array('response' => 401));
}
if (empty($data['fes-email-subject'])) {
wp_die(__('Please enter a subject for the email', 'edd-fes-product-updates'), __('Error', 'edd-fes-product-updates'), array('response' => 401));
}
if (empty($data['fes-email-message'])) {
wp_die(__('Please enter a message for the email', 'edd-fes-product-updates'), __('Error', 'edd-fes-product-updates'), array('response' => 401));
}
$products = $data['fes-email-products'];
// Verify all included products belong to the current user
foreach ($products as $key => $product_id) {
$product = get_post($product_id);
if ((int) get_current_user_id() !== (int) $product->post_author) {
unset($products[$key]);
}
}
// Re-verify there are products
if (empty($products)) {
wp_die(__('Please select at least one product', 'edd-fes-product-updates'), __('Error', 'edd-fes-product-updates'), array('response' => 401));
}
$author = get_userdata(get_current_user_id());
$subject = sanitize_text_field($data['fes-email-subject']);
$message = wp_kses_post($data['fes-email-message'] . "\n\n" . edd_get_option('fes_pu_default_footer'));
$from_name = $author->display_name;
$from_email = $author->user_email;
$auto_send = $this->auto_send($author->ID);
$args = array('post_type' => 'edd_pup_email', 'post_status' => 'draft', 'post_content' => $message, 'post_excerpt' => $subject, 'post_title' => sprintf(__('Vendor #%d: %s', 'edd-fes-product-updates'), $author->ID, $subject));
$email_id = wp_insert_post($args);
$recipients = edd_pup_customer_count($email_id, $products);
update_post_meta($email_id, '_edd_pup_subject', $subject);
update_post_meta($email_id, '_edd_pup_message', $message);
update_post_meta($email_id, '_edd_pup_from_name', $from_name);
update_post_meta($email_id, '_edd_pup_from_email', $from_email);
update_post_meta($email_id, '_edd_pup_updated_products', $products);
update_post_meta($email_id, '_edd_pup_recipients', $recipients);
if ($auto_send) {
} else {
$this->notify_admins($email_id, $author);
}
}
示例12: render_comments_table_row
function render_comments_table_row($comment)
{
$comment_date = get_comment_date('Y/m/d \\a\\t g:i a', $comment->comment_ID);
$comment_author_img = EDD_FES()->vendors->get_avatar('comment_author_image', $comment->comment_author_email, 32);
$purchased = edd_has_user_purchased($comment->user_id, $comment->comment_post_ID);
?>
<tr>
<td class="col-author" style="width:25%;">
<div class="fes-author-img"><?php
echo $comment_author_img;
?>
</div>
<span id="fes-comment-author"><?php
echo $comment->comment_author;
?>
</span>
<br /><br />
<?php
if ($purchased) {
echo '<div class="fes-light-green">' . __('Has Purchased', 'edd_fes') . '</div>';
} else {
echo '<div class="fes-light-red">' . __('Has Not Purchased', 'edd_fes') . '</div>';
}
?>
<span id="fes-comment-date"><?php
echo $comment_date;
?>
</span><br />
<span id="fes-product-name">
<b><?php
echo EDD_FES()->vendors->get_product_constant_name($plural = false, $uppercase = true) . ': ';
?>
</b>
<a href="<?php
echo esc_url(get_permalink($comment->comment_post_ID));
?>
"><?php
echo get_the_title($comment->comment_post_ID);
?>
</a>
</span><br />
<span id="fes-view-comment">
<a href="<?php
echo esc_url(get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID);
?>
"><?php
_e('View Comment', 'edd_fes');
?>
</a>
</span>
</td>
<td class="col-content" style="width:70%;">
<div class="fes-comments-content"><?php
echo $comment->comment_content;
?>
</div>
<hr/>
<div id="<?php
echo $comment->comment_post_ID;
?>
" class="fes-vendor-comment-respond-form">
<span><?php
_e('Respond:', 'edd_fes');
?>
</span><br/>
<table>
<tr>
<form id="fes_comments-form" action="" method="post">
<input type="hidden" name="cid" value="<?php
echo $comment->comment_ID;
?>
">
<input type="hidden" name="pid" value="<?php
echo $comment->comment_post_ID;
?>
">
<input type="hidden" name="aid" value="<?php
echo get_current_user_id();
?>
">
<?php
wp_nonce_field('fes_comment_nonce', 'fes_nonce');
?>
<textarea class="fes-cmt-body" name="newcomment_body" cols="50" rows="8"></textarea>
<button class="fes-cmt-submit-form button" type="submit"><?php
_e('Post Response', 'edd_fes');
?>
</button>
</form>
<form id="fes_ignore-form" action="" method="post">
<input type="hidden" name="cid" value="<?php
echo $comment->comment_ID;
?>
">
<?php
wp_nonce_field('fes_ignore_nonce', 'fes_nonce');
?>
<button class="fes-ignore button" type="submit"><?php
_e('Mark as Read', 'edd_fes');
?>
//.........这里部分代码省略.........
示例13: combo_form_count
public function combo_form_count()
{
if (EDD_FES()->vendors->can_see_registration() && EDD_FES()->vendors->can_see_login()) {
return 2;
}
if (EDD_FES()->vendors->can_see_registration() || EDD_FES()->vendors->can_see_login()) {
return 1;
} else {
return 0;
}
}
示例14: validate_re_captcha
function validate_re_captcha()
{
$recap_challenge = isset($_POST['recaptcha_challenge_field']) ? $_POST['recaptcha_challenge_field'] : '';
$recap_response = isset($_POST['recaptcha_response_field']) ? $_POST['recaptcha_response_field'] : '';
$private_key = EDD_FES()->helper->get_option('fes-recaptcha-private-key', '');
$resp = recaptcha_check_answer($private_key, $_SERVER["REMOTE_ADDR"], $recap_challenge, $recap_response);
if (!$resp->is_valid) {
$this->signal_error(__('reCAPTCHA validation failed', 'edd_fes'));
}
}
示例15:
<?php
if (EDD_FES()->integrations->is_commissions_active()) {
?>
<h1 class="fes-headers" id="fes-commissions-page-title"><?php
_e('Commissions Overview', 'edd_fes');
?>
</h1>
<?php
if (eddc_user_has_commissions()) {
echo do_shortcode('[edd_commissions]');
} else {
echo __('You haven\'t made any sales yet!', 'edd_fes');
}
} else {
echo 'Error 4908';
}