public static function getTranslationStatus($status) { static $cache = null; if ($cache === null) { $cache = \get_post_statuses(); } return isset($cache[$status]) ? $cache[$status] : $status; }
/** * Returns the according translation of the given post status, if available. * * @param string $status Post status. * * @return string The according translation of the given post status. */ private function get_translated_status($status) { static $cache; if (!$cache) { $cache = get_post_statuses(); } return isset($cache[$status]) ? $cache[$status] : esc_html($status); }
/** * Get the translated post status if possible. * * @param string $status * @return string */ private function get_translated_status($status) { static $statuses = FALSE; !$statuses and $statuses = get_post_statuses(); if (isset($statuses[$status])) { return $statuses[$status]; } return esc_html(ucfirst($status)); }
public static function handle_ajax_search() { check_ajax_referer('psu_search'); $args = array('post_type' => array()); if (!empty($_GET['post_type'])) { $unsanitized_post_types = array_map('sanitize_key', explode(',', $_GET['post_type'])); foreach ($unsanitized_post_types as $post_type) { if (($post_type_obj = get_post_type_object($post_type)) && current_user_can($post_type_obj->cap->read)) { $args['post_type'][] = $post_type; } } } if (count($args['post_type']) < 1) { die('-1'); } if (!empty($_GET['paged'])) { $args['paged'] = absint($_GET['paged']); } if (!empty($_GET['s'])) { $args['s'] = sanitize_text_field($_GET['s']); } if (!empty($_GET['order']) && in_array(strtolower($_GET['order']), array('asc', 'desc'))) { $args['order'] = $_GET['order']; } if (!empty($_GET['orderby'])) { $args['orderby'] = sanitize_text_field($_GET['orderby']); } if (!empty($_GET['post_status'])) { $post_statuses = explode(',', $_GET['post_status']); $defined_statuses = array_keys(get_post_statuses()); $allowed_statuses = array_merge($defined_statuses, array('inherit', 'any')); $filtered_statuses = array_intersect($post_statuses, $allowed_statuses); if (!empty($filtered_statuses)) { $args['post_status'] = $filtered_statuses; } } if (!empty($_GET['include'])) { $args['post__in'] = array_filter(array_map('intval', explode(',', $_GET['include']))); } if (!empty($_GET['exclude'])) { $selected = array_map('intval', explode(',', $_GET['exclude'])); } else { $selected = array(); } $name = 'foobar'; if (!empty($_GET['name'])) { $_name = sanitize_text_field($_GET['name']); if ($_name) { $name = $_name; } } $psu_box = new Post_Selection_Box($name, array('post_type' => $args['post_type'], 'selected' => $selected)); $response = new stdClass(); $response->rows = $psu_box->render_results($args); die(wp_send_json($response)); }
public static function init() { foreach (get_class_methods(__CLASS__) as $method) { if (!in_array($method, array('init', 'channels'))) { call_user_func(array(__CLASS__, $method)); } } # Trivial ones # User roles global $wp_roles; if (is_object($wp_roles)) { self::$roles = $wp_roles->role_names; } # ALL post statuses $post_statuses = array_merge(get_post_statuses(), array('auto-draft' => __('Auto Draft'), 'inherit' => __('Inherit', 'kc-settings'), 'trash' => __('Trash'), 'future' => __('Scheduled'))); asort($post_statuses); self::$post_statuses = $post_statuses; # Yes/No self::$yesno = array('0' => __('No', 'kc-settings'), '1' => __('Yes', 'kc-settings')); }
function sre2t_the_post_dates() { global $wpdb, $wp_locale; $dateoptions = ''; $types = "'" . implode("', '", get_post_types(array('public' => true, 'can_export' => true), 'names')) . "'"; if (function_exists(get_post_stati)) { $stati = "'" . implode("', '", get_post_stati(array('internal' => false), 'names')) . "'"; } else { $stati = "'" . implode("', '", get_post_statuses(array('internal' => false), 'names')) . "'"; } if ($monthyears = $wpdb->get_results("SELECT DISTINCT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, YEAR(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `eyear`, MONTH(DATE_ADD(post_date, INTERVAL 1 MONTH)) AS `emonth` FROM {$wpdb->posts} WHERE post_type IN ({$types}) AND post_status IN ({$stati}) ORDER BY post_date ASC ")) { foreach ($monthyears as $k => $monthyear) { $monthyears[$k]->lmonth = $wp_locale->get_month($monthyear->month, 2); } for ($s = 0, $e = count($monthyears) - 1; $e >= 0; $s++, $e--) { //$dateoptions .= "\t<option value=\"" . $monthyears[$s]->year . '-' . zeroise( $monthyears[$s]->month, 2 ) . '">' . $monthyears[$s]->lmonth . ' ' . $monthyears[$s]->year . "</option>\n"; $dateoptions .= "\t<option value=\"" . $monthyears[$e]->eyear . '-' . zeroise($monthyears[$e]->emonth, 2) . '">' . $monthyears[$e]->lmonth . ' ' . $monthyears[$e]->year . "</option>\n"; } } return $dateoptions; }
/** * Display the gig title column. * * Determines the gig title, accounting for an empty value and outputs * row actions based on capability. * * @since 1.0.0 * * @param WP_Post $item Gig post object. * @return string Column value. */ function column_title($item) { $statuses = get_post_statuses(); $status = 'publish' !== $item->post_status && array_key_exists($item->post_status, $statuses) ? ' - <strong>' . esc_html($statuses[$item->post_status]) . '</strong>' : ''; $date = empty($item->gig_datetime) ? __('(no date)', 'audiotheme') : mysql2date(get_option('date_format'), $item->gig_datetime); $out = sprintf('<strong><a href="%1$s" class="row-title">%2$s</a></strong> - %3$s%4$s<br>', esc_url(get_edit_post_link($item->ID)), esc_html($date), esc_html(empty($item->gig_time) ? 'TBD' : $item->gig_time), $status); $post_type_object = get_post_type_object($item->post_type); $can_edit_post = current_user_can($post_type_object->cap->edit_post, $item->ID); if ($can_edit_post && 'trash' !== $item->post_status) { $actions['edit'] = '<a href="' . get_edit_post_link($item->ID, true) . '" title="' . esc_attr(__('Edit this item', 'audiotheme')) . '">' . __('Edit', 'audiotheme') . '</a>'; #$actions['inline hide-if-no-js'] = '<a href="#" class="editinline" title="' . esc_attr( __( 'Edit this item inline' ) ) . '">' . __( 'Quick Edit' ) . '</a>'; } if (current_user_can($post_type_object->cap->delete_post, $item->ID)) { if ('trash' === $item->post_status) { $actions['untrash'] = "<a title='" . esc_attr(__('Restore this item from the Trash', 'audiotheme')) . "' href='" . wp_nonce_url(admin_url(sprintf($post_type_object->_edit_link . '&action=untrash', $item->ID)), 'untrash-post_' . $item->ID) . "'>" . __('Restore', 'audiotheme') . '</a>'; } elseif (EMPTY_TRASH_DAYS) { $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this item to the Trash', 'audiotheme')) . "' href='" . get_delete_post_link($item->ID) . "'>" . __('Trash', 'audiotheme') . '</a>'; } if ('trash' === $item->post_status || !EMPTY_TRASH_DAYS) { $onclick = " onclick=\"return confirm('" . esc_js(sprintf(__('Are you sure you want to delete this %s?', 'audiotheme'), strtolower($post_type_object->labels->singular_name))) . "');\""; $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this item permanently', 'audiotheme')) . "' href='" . get_delete_post_link($item->ID, '', true) . "'{$onclick}>" . __('Delete Permanently', 'audiotheme') . '</a>'; } } if ($post_type_object->public) { if (in_array($item->post_status, array('pending', 'draft', 'future'))) { if ($can_edit_post) { $actions['view'] = '<a href="' . esc_url(add_query_arg('preview', 'true', get_permalink($item->ID))) . '" title="' . esc_attr(sprintf(__('Preview “%s”', 'audiotheme'), $item->post_title)) . '" rel="permalink">' . __('Preview', 'audiotheme') . '</a>'; } } elseif ('trash' !== $item->post_status) { $actions['view'] = '<a href="' . esc_url(get_permalink($item->ID)) . '" title="' . esc_attr(sprintf(__('View “%s”', 'audiotheme'), $item->post_title)) . '" rel="permalink">' . __('View', 'audiotheme') . '</a>'; } } $out .= $this->row_actions($actions); return $out; }
/** * Output JSON for the children of a node * $arrOpenChilds = array with id of pages to open children on */ function cms_tpv_print_childs($pageID, $view = "all", $arrOpenChilds = null, $post_type) { $arrPages = cms_tpv_get_pages("parent={$pageID}&view={$view}&post_type={$post_type}"); if ($arrPages) { global $current_screen; $screen = convert_to_screen("edit"); #return; // If this is set to null then quick/bul edit stops working on posts (not pages) // If did set it to null sometime. Can't remember why... // $screen->post_type = null; $post_type_object = get_post_type_object($post_type); ob_start(); // some plugins, for example magic fields, return javascript and things here. we're not compatible with that, so just swallow any output $posts_columns = get_column_headers($screen); ob_get_clean(); unset($posts_columns["cb"], $posts_columns["title"], $posts_columns["author"], $posts_columns["categories"], $posts_columns["tags"], $posts_columns["date"]); global $post; // Translated post statuses $post_statuses = get_post_statuses(); ?> [<?php for ($i = 0, $pagesCount = sizeof($arrPages); $i < $pagesCount; $i++) { $onePage = $arrPages[$i]; $tmpPost = $post; $post = $onePage; $page_id = $onePage->ID; $arrChildPages = NULL; $editLink = get_edit_post_link($onePage->ID, 'notDisplay'); $content = esc_html($onePage->post_content); $content = str_replace(array("\n", "\r"), "", $content); $hasChildren = false; // if viewing trash, don't get children. we watch them "flat" instead if ($view == "trash") { } else { $arrChildPages = cms_tpv_get_pages("parent={$onePage->ID}&view={$view}&post_type={$post_type}"); } if (!empty($arrChildPages)) { $hasChildren = true; } // if no children, output no state $strState = '"state": "closed",'; if (!$hasChildren) { $strState = ''; } // type of node $rel = $onePage->post_status; if ($onePage->post_password) { $rel = "password"; } // modified time $post_modified_time = strtotime($onePage->post_modified); $post_modified_time = date_i18n(get_option('date_format'), $post_modified_time, false); // last edited by setup_postdata($post); $post_author = cms_tpv_get_the_modified_author(); if (empty($post_author)) { $post_author = __("Unknown user", 'cms-tree-page-view'); } $title = get_the_title($onePage->ID); // so hooks and stuff will do their work $title = apply_filters("cms_tree_page_view_post_title", $title, $onePage); if (empty($title)) { $title = __("<Untitled page>", 'cms-tree-page-view'); } $arr_page_css_styles = array(); $user_can_edit_page = apply_filters("cms_tree_page_view_post_can_edit", current_user_can($post_type_object->cap->edit_post, $page_id), $page_id); $user_can_add_inside = apply_filters("cms_tree_page_view_post_user_can_add_inside", current_user_can($post_type_object->cap->create_posts, $page_id), $page_id); $user_can_add_after = apply_filters("cms_tree_page_view_post_user_can_add_after", current_user_can($post_type_object->cap->create_posts, $page_id), $page_id); if ($user_can_edit_page) { $arr_page_css_styles[] = "cms_tpv_user_can_edit_page_yes"; } else { $arr_page_css_styles[] = "cms_tpv_user_can_edit_page_no"; } if ($user_can_add_inside) { $arr_page_css_styles[] = "cms_tpv_user_can_add_page_inside_yes"; } else { $arr_page_css_styles[] = "cms_tpv_user_can_add_page_inside_no"; } if ($user_can_add_after) { $arr_page_css_styles[] = "cms_tpv_user_can_add_page_after_yes"; } else { $arr_page_css_styles[] = "cms_tpv_user_can_add_page_after_no"; } $page_css = join(" ", $arr_page_css_styles); // fetch columns $str_columns = ""; foreach ($posts_columns as $column_name => $column_display_name) { $col_name = $column_display_name; if ($column_name == "comments") { $col_name = __("Comments"); } $str_columns .= "<dt>{$col_name}</dt>"; $str_columns .= "<dd>"; if ($column_name == "comments") { $str_columns .= '<div class="post-com-count-wrapper">'; $left = get_pending_comments_num($onePage->ID); $pending_phrase = sprintf(__('%s pending'), number_format($left)); $pending_phrase2 = ""; if ($left) { $pending_phrase2 = " + {$left} " . __("pending"); } if ($left) { $str_columns .= '<strong>'; } ob_start(); comments_number("<a href='edit-comments.php?p={$page_id}' title='{$pending_phrase}'><span>" . _x('0', 'comment count') . "{$pending_phrase2}</span></a>", "<a href='edit-comments.php?p={$page_id}' title='{$pending_phrase}' class=''><span class=''>" . _x('1', 'comment count') . "{$pending_phrase2}</span></a>", "<a href='edit-comments.php?p={$page_id}' title='{$pending_phrase}' class=''><span class=''>" . _x('%', 'comment count') . "{$pending_phrase2}</span></a>"); $str_columns .= ob_get_clean(); if ($left) { $str_columns .= '</strong>'; } $str_columns .= "</div>"; } else { ob_start(); do_action('manage_pages_custom_column', $column_name, $onePage->ID); $str_columns .= ob_get_clean(); } $str_columns .= "</dd>"; } if ($str_columns) { $str_columns = "<dl>{$str_columns}</dl>"; } $str_columns = json_encode($str_columns); ?> { "data": { "title": <?php echo json_encode($title); ?> , "attr": { "href": "<?php echo $editLink; ?> " <?php /* , "xid": "cms-tpv-<?php echo $onePage->ID ?>" */ ?> }<?php /*, "xicon": "<?php echo CMS_TPV_URL . "images/page_white_text.png" ?>"*/ ?> }, "attr": { <?php /* "xhref": "<?php echo $editLink ?>", */ ?> "id": "cms-tpv-<?php echo $onePage->ID; ?> ", <?php /* "xtitle": "<?php _e("Click to edit. Drag to move.", 'cms-tree-page-view') ?>", */ ?> "class": "<?php echo $page_css; ?> " }, <?php echo $strState; ?> "metadata": { "id": "cms-tpv-<?php echo $onePage->ID; ?> ", "post_id": "<?php echo $onePage->ID; ?> ", "post_type": "<?php echo $onePage->post_type; ?> ", "post_status": "<?php echo $onePage->post_status; ?> ", "post_status_translated": "<?php echo isset($post_statuses[$onePage->post_status]) ? $post_statuses[$onePage->post_status] : $onePage->post_status; ?> ", "rel": "<?php echo $rel; ?> ", "childCount": <?php echo !empty($arrChildPages) ? sizeof($arrChildPages) : 0; ?> , "permalink": "<?php echo htmlspecialchars_decode(get_permalink($onePage->ID)); ?> ", "editlink": "<?php echo htmlspecialchars_decode($editLink); ?> ", "modified_time": "<?php echo $post_modified_time; ?> ", "modified_author": "<?php echo $post_author; ?> ", "columns": <?php echo $str_columns; ?> , "user_can_edit_page": "<?php echo (int) $user_can_edit_page; ?> ", "user_can_add_page_inside": "<?php echo (int) $user_can_add_inside; ?> ", "user_can_add_page_after": "<?php echo (int) $user_can_add_after; ?> ", "post_title": <?php echo json_encode($title); ?> } <?php // if id is in $arrOpenChilds then also output children on this one // TODO: if only "a few" (< 100?) pages then load all, but keep closed, so we don't have to do the ajax thingie if ($hasChildren && isset($arrOpenChilds) && in_array($onePage->ID, $arrOpenChilds)) { ?> , "children": <?php cms_tpv_print_childs($onePage->ID, $view, $arrOpenChilds, $post_type); } ?> } <?php // no comma for last page if ($i < $pagesCount - 1) { ?> ,<?php } // return orgiginal post $post = $tmpPost; } ?> ]<?php } }
/** * Gets all WordPress built in post status (to be used in filters) * * @package WP Idea Stream * @subpackage ideas/functions * * @since 2.0.0 * * @param array $status * @return array the available post status */ function wp_idea_stream_ideas_get_all_status($status = array()) { return array_keys(get_post_statuses()); }
public function render_site_options_pull($site_id) { //TODO: JS if is_meta show text box, if is_photo show photo select with numbers as values, else show select of post fields //TODO: JS Validation //TODO: deal with ability to select, i.e. media:group/media:thumbnail[@width="75"]/@url (can't be unserialized as is with quotes around 75) $feed_url = get_post_meta($site_id, 'syn_feed_url', true); $default_post_type = get_post_meta($site_id, 'syn_default_post_type', true); $default_post_status = get_post_meta($site_id, 'syn_default_post_status', true); $default_comment_status = get_post_meta($site_id, 'syn_default_comment_status', true); $default_ping_status = get_post_meta($site_id, 'syn_default_ping_status', true); $node_config = get_post_meta($site_id, 'syn_node_config', true); $id_field = get_post_meta($site_id, 'syn_id_field', true); $enc_field = get_post_meta($site_id, 'syn_enc_field', true); $enc_is_photo = get_post_meta($site_id, 'syn_enc_is_photo', true); if (isset($node_config['namespace'])) { $namespace = $node_config['namespace']; } //unset is outside of isset() test to remove the item from the array if the key is there with no value $namespace = isset($node_config['namespace']) ? $node_config['namespace'] : null; unset($node_config['namespace']); $post_root = isset($node_config['post_root']) ? $node_config['post_root'] : null; unset($node_config['post_root']); $enc_parent = isset($node_config['enc_parent']) ? $node_config['enc_parent'] : null; unset($node_config['enc_parent']); $categories = isset($node_config['categories']) && !empty($node_config['categories']) ? (array) $node_config['categories'] : null; unset($node_config['categories']); $custom_nodes = $node_config['nodes']; ?> <p> <label for="feed_url"><?php esc_html_e('Enter feed URL', 'push-syndication'); ?> </label> </p> <p> <input type="text" name="feed_url" id="feed_url" size="100" value="<?php esc_attr_e($feed_url); ?> " /> </p> <p> <label for="default_post_type"><?php esc_html_e('Select post type', 'push-syndication'); ?> </label> </p> <p> <select name="default_post_type" id="default_post_type"> <?php $post_types = get_post_types(); foreach ($post_types as $post_type) { ?> <option value="<?php esc_attr_e($post_type); ?> " <?php selected($post_type, $default_post_type); ?> ><?php esc_html_e($post_type); ?> </option> <?php } ?> </select> </p> <p> <label for="default_post_status"><?php esc_html_e('Select post status', 'push-syndication'); ?> </label> </p> <p> <select name="default_post_status" id="default_post_status"> <?php $post_statuses = get_post_statuses(); foreach ($post_statuses as $key => $value) { ?> <option value="<?php esc_attr_e($key); ?> " <?php selected($key, $default_post_status); ?> ><?php esc_html_e($key); ?> </option> <?php } ?> </select> </p> <p> <label for="default_comment_status"><?php esc_html_e('Select comment status', 'push-syndication'); ?> </label> </p> <p> <select name="default_comment_status" id="default_comment_status"> <option value="open" <?php selected('open', $default_comment_status); ?> ><?php _e('open', 'push-syndication'); ?> </option> <option value="closed" <?php selected('closed', $default_comment_status); ?> ><?php _e('closed', 'push-syndication'); ?> </option> </select> </p> <p> <label for="default_ping_status"><?php esc_html_e('Select ping status', 'push-syndication'); ?> </label> </p> <p> <select name="default_ping_status" id="default_ping_status"> <option value="open" <?php selected('open', $default_ping_status); ?> ><?php _e('open', 'push-syndication'); ?> </option> <option value="closed" <?php selected('closed', $default_ping_status); ?> ><?php _e('closed', 'push-syndication'); ?> </option> </select> </p> <p> <label for="namespace"><?php esc_html_e('Enter XML namespace', 'push-syndication'); ?> </label> </p> <p> <input type="text" size="75" name="namespace" id="namespace" value="<?php esc_attr_e($namespace); ?> " /> </p> <p> <label for="post_root"><?php esc_html_e('Enter XPath to post root', 'push-syndication'); ?> </label> </p> <p> <input type="text" name="post_root" id="post_root" value="<?php esc_attr_e($post_root); ?> " /> </p> <p> <label for="id_field"><?php esc_html_e('Enter post meta key for unique post identifier', 'push-syndication'); ?> </label> </p> <p> <input type="text" name="id_field" id="id_field" value="<?php esc_attr_e($id_field); ?> " /> </p> <p> <label for="enc_parent"><?php esc_html_e('Enter parent element for enclosures', 'push-syndication'); ?> </label> </p> <p> <input type="text" name="enc_parent" id="enc_parent" value="<?php esc_attr_e($enc_parent); ?> " /> </p> <p> <label for="enc_field"><?php esc_html_e('Enter meta name for enclosures', 'push-syndication'); ?> </label> </p> <p> <input type="text" name="enc_field" id="enc_field" value="<?php esc_attr_e($enc_field); ?> " /> </p> <p> <label for="enc_is_photo"> <input type="checkbox" name="enc_is_photo" id="enc_is_photo" value="1" <?php checked($enc_is_photo); ?> /> <?php esc_html_e('Enclosure is an image file', 'push-syndication'); ?> </label> </p> <p> <label for="categories"><?php esc_html_e('Select category/categories', 'push-syndication'); ?> </label> </p> <p> <?php add_filter('wp_dropdown_cats', array(__CLASS__, 'make_multiple_categories_dropdown')); wp_dropdown_categories(array('hide_empty' => false, 'hierarchical' => true, 'selected_array' => $categories, 'walker' => new Walker_CategoryDropdownMultiple(), 'name' => 'categories[]')); remove_filter('wp_dropdown_cats', array(__CLASS__, 'make_multiple_categories_dropdown')); ?> </p> <h2><?php _e('XPath-to-Data Mapping', 'push-syndication'); ?> </h2> <p><?php printf(__('<strong>PLEASE NOTE:</strong> %s are required. If you want a link to another site, %s is required. To include a static string, enclose the string as "%s(your_string_here)" — no quotes.', 'push-syndication'), 'post_title, post_guid, guid', 'is_permalink', 'string'); ?> </p> <ul class='syn-xml-client-xpath-head syn-xml-client-list-head'> <li class="text"> <label for="xpath"><?php esc_html_e('XPath Expression', 'push-syndication'); ?> </label> </li> <li> <label for="item_node"><?php esc_html_e('Item', 'push-syndication'); ?> </label> </li> <li> <label for="photo_node"><?php esc_html_e('Enc.', 'push-syndication'); ?> </label> </li> <li> <label for="meta_node"><?php esc_html_e('Meta', 'push-syndication'); ?> </label> </li> <li> <label for="tax_node"><?php esc_html_e('Tax', 'push-syndication'); ?> </label> </li> <li class="text"> <label for="item_field"><?php esc_html_e('Field in Post', 'push-syndication'); ?> </label> </li> </ul> <?php $rowcount = 0; if (!empty($custom_nodes)) { foreach ($custom_nodes as $key => $storage_locations) { foreach ($storage_locations as $storage_location) { ?> <ul class='syn-xml-client-xpath-form syn-xml-client-xpath-list syn-xml-client-list' data-row-count="<?php echo (int) $rowcount; ?> "> <li class="text"> <input type="text" name="node[<?php echo (int) $rowcount; ?> ][xpath]" id="node-<?php echo (int) $rowcount; ?> -xpath" value="<?php echo htmlspecialchars(stripslashes($key)); ?> " /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_item]" id="node-<?php echo (int) $rowcount; ?> -is_item" <?php checked($storage_location['is_item']); ?> value="true" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_photo]" id="node-<?php echo (int) $rowcount; ?> -is_photo" <?php checked($storage_location['is_photo']); ?> value="true" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_meta]" id="node-<?php echo (int) $rowcount; ?> -is_meta" <?php checked($storage_location['is_meta']); ?> value="true" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_tax]" id="node-<?php echo (int) $rowcount; ?> -is_tax" <?php checked($storage_location['is_tax']); ?> value="true" /> </li> <li class="text"> <input type="text" name="node[<?php echo (int) $rowcount; ?> ][field]" id="node-<?php echo (int) $rowcount; ?> -field" value="<?php echo stripcslashes($storage_location['field']); ?> " /> </li> <a href="#" class="syn-delete syn-pull-xpath-delete"><?php _e('Delete', 'push-syndication'); ?> </a> <?php } ?> </ul> <?php ++$rowcount; } } ?> <ul class='syn-xml-client-xpath-form syn-xml-xpath-list syn-xml-client-list' data-row-count="<?php echo (int) $rowcount; ?> "> <li class="text"> <input type="text" name="node[<?php echo (int) $rowcount; ?> ][xpath]" id="node-<?php echo (int) $rowcount; ?> -xpath" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_item]" id="node-<?php echo (int) $rowcount; ?> -is_item" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_photo]" id="node-<?php echo (int) $rowcount; ?> -is_photo" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_meta]" id="node-<?php echo (int) $rowcount; ?> -is_meta" /> </li> <li> <input type="checkbox" name="node[<?php echo (int) $rowcount; ?> ][is_tax]" id="node-<?php echo (int) $rowcount; ?> -is_tax" /> </li> <li class="text"> <input type="text" name="node[<?php echo (int) $rowcount; ?> ][field]" id="node-<?php echo (int) $rowcount; ?> -field" /> </li> <a href="#" class="syn-delete syn-pull-xpath-delete"><?php _e('Delete', 'push-syndication'); ?> </a> </ul> <a href="#" class="syn-pull-xpath-add-new button"><?php _e('Add new', 'push-syndication'); ?> </a> <script> jQuery( document ).ready( function ( $ ) { $( '.syn-pull-xpath-delete' ).on( 'click', function ( e ) { e.preventDefault(); $( this ).closest( '.syn-xml-client-xpath-form' ).remove(); } ); $( '.syn-pull-xpath-add-new' ).on( 'click', function ( e ) { e.preventDefault(); var $lastForm = $( '.syn-xml-client-xpath-form:last' ), $newForm = $lastForm.clone(), originalRowCount = parseInt( $lastForm.attr( 'data-row-count' ) ), newRowCount = originalRowCount + 1; $newForm.attr( 'data-row-count', newRowCount ); $newForm.find( 'input' ).each( function () { var $this = $( this ), name = $this.attr( 'name' ), type = $this.attr( 'type' ); if ( 'radio' === type || 'checkbox' === type ) { $this.attr( 'checked', false ); } else if ( 'select' === type ) { $this.attr( 'selected', false ); } else { $this.val( '' ); } name = name.replace( '[' + ( originalRowCount ) + ']', '[' + newRowCount + ']' ); $this.attr( 'name', name ); // hack hack hack!!! } ); $newForm.insertAfter( $lastForm ); } ); } ); </script> <?php }
<th class="frontier-menu" ><a id="frontier-post-add-new-link" href='<?php echo frontier_post_add_link($tmp_p_id); ?> '><?php echo $tmp_add_text; ?> </a></th> <th class="frontier-menu" > </th> </tr> </table> <?php } // if can_add if ($user_posts->found_posts > 0) { $tmp_status_list = get_post_statuses(); // If post for all users is viewed, show author instead of category if ($frontier_list_all_posts == "true" || $frontier_list_pending_posts == "true") { $cat_author_heading = __("Author", "frontier-post"); } else { $cat_author_heading = __("Category", "frontier-post"); } ?> <table class="frontier-list" id="user_post_list"> <div id="frontier-post-list-heading"> <thead> <tr> <th class="frontier-list-posts" id="frontier-list-posts-date"><?php _e("Date", "frontier-post"); ?>
/** * Runs in wp_footer, adds spinner and settings modal */ public function wa_fronted_footer() { if (is_array(WA_Fronted::$options) && !empty(WA_Fronted::$options) && WA_Fronted::$options !== false) { global $post; require_once ABSPATH . '/wp-admin/includes/post.php'; require_once ABSPATH . '/wp-admin/includes/admin.php'; $field_prefix = 'wa_fronted_'; $default_fieldgroups = array('post_slug', 'post_status', 'post_date', 'post_parent', 'sticky', 'comment_status', 'taxonomies'); $field_groups = apply_filters('wa_fronted_settings_fields', $default_fieldgroups); ?> <div id="wa-fronted-settings-modal"> <div class="wa-fronted-modal-inner"> <button class="close-wa-fronted-modal"><i class="fa fa-close"></i></button> <form id="wa-fronted-settings" method="POST"> <?php if (is_array($field_groups) && !empty($field_groups)) { foreach ($field_groups as $field_group) { switch ($field_group) { case 'post_slug': ?> <div class="fieldgroup"> <label for="<?php echo $field_prefix; ?> post_name"><?php _e('Post slug', 'wa-fronted'); ?> </label> <input type="text" name="<?php echo $field_prefix; ?> post_name" id="<?php echo $field_prefix; ?> post_name" value="<?php echo $post->post_name; ?> "> </div> <?php break; case 'post_status': $all_statuses = get_post_statuses(); $current_post_status = get_post_status($post->ID); ?> <div class="fieldgroup"> <label for="<?php echo $field_prefix; ?> post_status"><?php _e('Post status', 'wa-fronted'); ?> </label> <select name="<?php echo $field_prefix; ?> post_status" id="<?php echo $field_prefix; ?> post_status"> <?php foreach ($all_statuses as $status_key => $status_label) { ?> <option value="<?php echo $status_key; ?> " <?php echo $current_post_status == $status_key ? 'selected' : ''; ?> > <?php echo $status_label; ?> </option> <?php } ?> </select> </div> <?php break; case 'post_date': ?> <div class="fieldgroup"> <label for="<?php echo $field_prefix; ?> post_date"><?php _e('Post date', 'wa-fronted'); ?> </label> <input type="text" name="<?php echo $field_prefix; ?> post_date" id="<?php echo $field_prefix; ?> post_date" class="wa_fronted_datepicker" value="<?php echo $post->post_date; ?> "> </div> <?php break; case 'post_parent': if (is_post_type_hierarchical($post->post_type)) { $all_pages = get_posts(array('posts_per_page' => -1, 'orderby' => 'title', 'post_type' => $post->post_type, 'exclude' => array($post->ID))); ?> <div class="fieldgroup"> <label for="<?php echo $field_prefix; ?> post_parent"><?php _e('Post parent', 'wa-fronted'); ?> </label> <select name="<?php echo $field_prefix; ?> post_parent" id="<?php echo $field_prefix; ?> post_parent"> <option value="false"><?php _e('No parent', 'wa-fronted'); ?> </option> <?php foreach ($all_pages as $page) { ?> <option value="<?php echo $page->ID; ?> " <?php echo $page->ID == $post->post_parent ? 'selected' : ''; ?> > <?php echo $page->post_title; ?> </option> <?php } ?> </select> </div> <?php } break; case 'sticky': case 'comment_status': if (get_post_type($post) == 'post') { if ($field_group == 'comment_status') { $field_label = __('Allow comments', 'wa-fronted'); $is_checked = $post->comment_status == 'open'; } else { $field_label = __('Set post as sticky', 'wa-fronted'); $is_checked = is_sticky($post->ID); } //If both values are to be displayed, allow for them to be on the same row $target = array('sticky', 'comment_status'); $extra_class = 'checkbox-fieldgroup '; if (count(array_intersect($field_groups, $target)) == count($target)) { $extra_class .= 'half'; } ?> <div class="fieldgroup <?php echo $extra_class; ?> "> <input type="checkbox" name="<?php echo $field_prefix . $field_group; ?> " id="<?php echo $field_prefix . $field_group; ?> " value="1" <?php echo $is_checked ? 'checked' : ''; ?> > <label for="<?php echo $field_prefix . $field_group; ?> "><?php echo $field_label; ?> </label> </div> <?php } break; case 'taxonomies': $available_taxonomies = get_object_taxonomies($post, 'objects'); if (!empty($available_taxonomies)) { foreach ($available_taxonomies as $taxonomy) { if ($taxonomy->public && $taxonomy->show_ui) { $terms = get_terms($taxonomy->name, array('hide_empty' => false, 'fields' => all)); $set_terms = wp_get_post_terms($post->ID, $taxonomy->name, array('fields' => 'ids')); $data_attrs = array('data-placeholder="' . __('Select') . ' ' . $taxonomy->labels->name . '"', 'data-tags="true"', 'data-tax="' . $taxonomy->name . '"', 'data-multiple="true"'); if ($taxonomy->hierarchical) { //Taxonomy is "category-type" $data_attrs[] = 'data-hierarchical="true"'; } else { //Taxonomy is "tag-type" } ?> <div class="fieldgroup"> <label for="<?php echo $field_prefix; ?> tax_<?php echo $taxonomy->name; ?> "><?php echo $taxonomy->label; ?> </label> <select multiple name="<?php echo $field_prefix; ?> tax_<?php echo $taxonomy->name; ?> []" id="<?php echo $field_prefix; ?> tax_<?php echo $taxonomy->name; ?> " <?php echo implode(' ', $data_attrs); ?> > <?php if (!empty($terms)) { ?> <?php foreach ($terms as $term) { ?> <option value="<?php echo $term->term_id; ?> " <?php echo in_array($term->term_id, $set_terms) ? 'selected' : ''; ?> > <?php echo $term->name; ?> </option> <?php } ?> <?php } ?> </select> </div> <?php } } } break; } } } do_action('wa_fronted_settings_form', WA_Fronted::$options); wp_nonce_field('wa_fronted_settings_save', 'wa_fronted_settings_nonce'); ?> <input type="hidden" name="<?php echo $field_prefix; ?> post_id" id="<?php echo $field_prefix; ?> post_id" value="<?php echo $post->ID; ?> "> <div class="wa-fronted-modal-footer"> <button type="submit" class="button button-primary button-large submit-wa-fronted-modal"><i class="dashicons dashicons-yes"></i> Update</button> <?php do_action('wa_fronted_settings_modal_footer', WA_Fronted::$options); ?> </div> </form> </div> </div> <?php if (post_type_supports($post->post_type, 'revisions')) { ?> <div id="wa-fronted-revisions-modal"> <div class="wa-fronted-revisions-modal-inner"> <button class="close-wa-fronted-modal"><i class="fa fa-close"></i></button> <div class="revision-input-container"> <h4><?php _e('Step through revisions', 'wa-fronted'); ?> </h4> <button id="wa-previous-revision"><i class="fa fa-chevron-left"></i></button> <input type="text" name="wa_fronted_switch_revision" id="wa_fronted_switch_revision" readonly> <button id="wa-next-revision"><i class="fa fa-chevron-right"></i></button> </div> </div> </div> <?php } ?> <div id="wa-fronted-edit-shortcode"> <div class="wa-fronted-edit-shortcode-inner"> <button id="wa-fronted-edit-shortcode-button" class="show"><i class="dashicons dashicons-edit"></i></button> <button id="wa-fronted-remove-shortcode-button" class="show"><i class="dashicons dashicons-no"></i></button> <div class="shortcode-input-wrapper"> <input type="text" name="wa_fronted_shortcode_input" id="wa_fronted_shortcode_input"> <button id="submit-shortcode"><i class="dashicons dashicons-yes"></i></button> </div> </div> </div> <div id="wa-fronted-spinner"> <img src="<?php echo includes_url(); ?> /images/spinner-2x.gif"> </div> <?php } }
/** * Retrieve post statuses. * * @since 2.5.0 * * @param array $args Method parameters. * @return array */ function wp_getPostStatusList($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if (!($user = $this->login($username, $password))) { return $this->error; } if (!current_user_can('edit_posts')) { return new IXR_Error(403, __('You are not allowed access to details about this site.')); } do_action('xmlrpc_call', 'wp.getPostStatusList'); return get_post_statuses(); }
function get_post_statuses() { return array_merge(get_post_statuses(), array('future' => __('Scheduled', WYSIJA))); }
function frontier_post_admin_page_general() { //must check that the user has the required capability if (!current_user_can('manage_options')) { wp_die(__('You do not have sufficient permissions to access this page.')); } require FRONTIER_POST_DIR . "/include/frontier_post_defaults.php"; //include("../include/frontier_post_defaults.php"); echo '<strong>Frontier Post - Version: ' . FRONTIER_POST_VERSION . '</strong>'; // **************************************************************************** // Save settings //******************************************************************************* // See if the user has posted us some information // If they did, this hidden field will be set to 'Y' if (isset($_POST["frontier_isupdated_general_hidden"]) && $_POST["frontier_isupdated_general_hidden"] == 'Y') { $fps_save_general_options = frontier_post_get_settings(); foreach ($fps_general_option_list as $tmp_option_name) { if (!key_exists($tmp_option_name, $fps_save_general_options)) { $fps_save_general_options[$tmp_option_name] = $fps_general_defaults[$tmp_option_name]; } $fps_save_general_options[$tmp_option_name] = isset($_POST[$tmp_option_name]) ? $_POST[$tmp_option_name] : ""; //echo "Saving. ".$tmp_option_name." - Value: ".$fps_save_general_options[$tmp_option_name]."<br>"; } update_option(FRONTIER_POST_SETTINGS_OPTION_NAME, $fps_save_general_options); // Put an settings updated message on the screen echo '<div class="updated"><p><strong>' . __('Settings saved.', 'frontier-post') . '</strong></p></div>'; } // end update options $fps_general_options = frontier_post_get_settings(); $fps_post_status_list = get_post_statuses(); echo '<div class="wrap">'; echo '<div class="frontier-admin-menu">'; echo '<h2>' . __("Frontier Post Settings", "frontier-post") . '</h2>'; echo '<hr>' . __("Documentation", "frontier_post") . ': <a href="http://wpfrontier.com/frontier-post-settings/" target="_blank">General Settings</a>'; echo ' - <a href="http://wpfrontier.com/frontier-post-shortcodes/" target="_blank">Shortcodes</a><hr>'; echo '<form name="frontier_post_settings" method="post" action="">'; echo '<input type="hidden" name="frontier_isupdated_general_hidden" value="Y">'; echo '<table border="1" cellspacing="0" cellpadding="0">'; echo "<tr>"; echo "<td>" . __("Allow edit of posts with comments", "frontier-post") . "</td>"; fps_html_field("fps_edit_w_comments", 'checkbox', $fps_general_options, true); echo "<td>" . __("Max age in days to allow edit of post", "frontier-post") . "</td>"; fps_html_field("fps_edit_max_age", 'text', $fps_general_options, true); echo "</tr><tr>"; echo "<td>" . __("Allow deletion of posts with comments", "frontier-post") . "</td>"; fps_html_field("fps_del_w_comments", 'checkbox', $fps_general_options, true); echo "<td>" . __("Max age in days to allow delete of post", "frontier-post") . "</td>"; fps_html_field("fps_delete_max_age", 'text', $fps_general_options, true); echo "</tr><tr>"; echo "<td>" . __("Number of post per page", "frontier-post") . "</td>"; fps_html_field("fps_ppp", 'text', $fps_general_options, true); echo "<td>" . __("Page containing [frontier-post] shortcode", "frontier-post") . "</td>"; echo "<td>"; wp_dropdown_pages(array('name' => 'fps_page_id', 'id' => 'fps_page_id', 'dept' => 1, 'hide_empty' => 0, 'selected' => $fps_general_options['fps_page_id'], 'hierarchical' => true, 'show_option_none' => __('None'))); echo "</td>"; echo "</tr><tr>"; echo "<td>" . __("Default status for new posts", "frontier-post") . "</td>"; fps_html_field("fps_default_status", 'select', $fps_general_options, true, 1, $fps_post_status_list); echo "<td>" . __("Page for pending posts ", "frontier-post") . "</td>"; echo "<td>"; wp_dropdown_pages(array('name' => 'fps_pending_page_id', 'id' => 'fps_pending_page_id', 'dept' => 1, 'hide_empty' => 0, 'selected' => $fps_general_options['fps_pending_page_id'], 'hierarchical' => true, 'show_option_none' => __('None'))); echo "</td>"; echo '</tr></table><hr>'; //***************************************************************************** // Additional options //***************************************************************************** //echo '<hr>'; //echo '<h2>'.__("Additional options", "frontier-post").'</h2>'; echo '<table border="1" cellspacing=" "2" cellpadding="1">'; echo "<tr>"; echo '<th colspan="3"></center>' . __("Additional options", "frontier-post") . '</center></th>'; echo "</tr><tr>"; echo "<td>" . __("Allow users to change status from Published", "frontier-post") . "</td>"; fps_html_field("fps_change_status", 'checkbox', $fps_general_options, true, 1); echo "<td>" . __("Once published users can change status back to draft/pending", "frontier-post") . "</td>"; echo "</tr><tr>"; echo "<td>" . __("Use featured image", "frontier-post") . "</td>"; fps_html_field("fps_show_feat_img", 'checkbox', $fps_general_options, true, 1); echo "<td>" . __("Enables selection of featured image from frontend form ", "frontier-post") . "(does not work perfectly)</td>"; echo "</tr><tr>"; echo "<td>" . __("Show link to login page", "frontier-post") . "</td>"; fps_html_field("fps_show_login", 'checkbox', $fps_general_options, true, 1); echo "<td>" . __("Shows link to wp-login.php after text: Please login", "frontier-post") . "</td>"; echo "</tr><tr>"; echo "<td>" . __("Show add/update/delete messages", "frontier-post") . "</td>"; fps_html_field("fps_show_msg", 'checkbox', $fps_general_options, true, 1); echo "<td>" . __("Show message on the form confirming a post has been added/updated/deleted", "frontier-post") . "</td>"; echo "</tr><tr>"; echo "<td>" . __("Show edit/delete/view icons in list", "frontier-post") . "</td>"; fps_html_field("fps_use_icons", 'checkbox', $fps_general_options, true, 1); $tmptext = "<td>" . __("Show icons instead of text for edit/delete/view in list", "frontier-post"); $tmptext .= " " . '<img height="12px" src="' . FRONTIER_POST_URL . '/images/edit.png' . '"></img>'; $tmptext .= " " . '<img height="12px" src="' . FRONTIER_POST_URL . '/images/delete.png' . '"></img>'; $tmptext .= " " . '<img height="12px" src="' . FRONTIER_POST_URL . '/images/view.png' . '"></img>'; $tmptext .= "</td>"; echo $tmptext; echo "</tr><tr>"; echo "<td>" . __("Hide Add New Post link on list", "frontier-post") . "</td>"; fps_html_field("fps_hide_add_on_list", 'checkbox', $fps_general_options, true, 1); echo "<td>" . __("Hide add new post on list form", "frontier-post") . "</td>"; echo "</tr><tr>"; echo "<td>" . __("Show submit buttons on post edit form", "frontier-post") . "</td>"; echo "<td></td>"; echo '<td>'; echo ' ' . __("Save", "frontier-post") . ' ' . fps_checkbox_field("fps_submit_save", $fps_general_options['fps_submit_save']); echo ' | ' . __("Save & Return", "frontier-post") . ' ' . fps_checkbox_field("fps_submit_savereturn", $fps_general_options['fps_submit_savereturn']); echo ' | ' . __("Save & Preview", "frontier-post") . ' ' . fps_checkbox_field("fps_submit_preview", $fps_general_options['fps_submit_preview']); echo ' | ' . __("Cancel", "frontier-post") . ' ' . fps_checkbox_field("fps_submit_cancel", $fps_general_options['fps_submit_cancel']); echo "</td>"; echo "</tr><tr>"; echo "<td>" . __("Allowed Post Types", "frontier-post") . "</td>"; echo "<td></td>"; echo "<td><strong>" . __("Post Types", "frontier-post") . ":</strong><br>"; echo fps_checkbox_select_field("fps_custom_post_type_list[]", $fps_general_options["fps_custom_post_type_list"], fp_get_post_type_list()) . "</td>"; echo "</tr><tr>"; echo "<td>" . __("List Layout", "frontier-post") . "</td>"; echo "<td></td>"; fps_html_field("fps_default_list", 'select', $fps_general_options, true, 1, $frontier_list_forms); echo "</tr><tr>"; echo "<td>" . __("Exclude categories", "frontier-post") . "</td>"; echo "<td></td>"; echo "<td>"; echo fps_text_field("fps_excl_cats", $fps_general_options['fps_excl_cats'], 100); echo '<br>' . __('comma separated list of IDs', 'frontier-post'); echo "</td>"; echo '</tr></table>'; echo '<p class="submit"><input type="submit" name="Submit" class="button-primary" value="' . __('Save Changes') . '"></p>'; echo '</form>'; echo '<hr>'; echo '</div>'; //frontier-admin-menu echo '</div>'; //wrap }
/** * Get the query params for collections of attachments. * * @return array */ public function get_collection_params() { $params = parent::get_collection_params(); $params['slug'] = array('description' => __('Limit result set to products with a specific slug.', 'woocommerce', 'woocommerce'), 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg'); $params['status'] = array('default' => 'any', 'description' => __('Limit result set to products assigned a specific status.', 'woocommerce'), 'type' => 'string', 'enum' => array_merge(array('any'), array_keys(get_post_statuses())), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg'); $params['type'] = array('description' => __('Limit result set to products assigned a specific type.', 'woocommerce'), 'type' => 'string', 'enum' => array_keys(wc_get_product_types()), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg'); $params['category'] = array('description' => __('Limit result set to products assigned a specific category.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['tag'] = array('description' => __('Limit result set to products assigned a specific tag.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['shipping_class'] = array('description' => __('Limit result set to products assigned a specific shipping class.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['attribute'] = array('description' => __('Limit result set to products with a specific attribute.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['attribute_term'] = array('description' => __('Limit result set to products with a specific attribute term (required an assigned attribute).', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['sku'] = array('description' => __('Limit result set to products with a specific SKU.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); return $params; }
/** * Render form expiration tab */ public static function render_form_expiration_tab() { global $post; $form_settings = wpuf_get_form_settings($post->ID); $is_post_exp_selected = isset($form_settings['expiration_settings']['enable_post_expiration']) ? 'checked' : ''; $time_value = isset($form_settings['expiration_settings']['expiration_time_value']) ? $form_settings['expiration_settings']['expiration_time_value'] : 1; $time_type = isset($form_settings['expiration_settings']['expiration_time_type']) ? $form_settings['expiration_settings']['expiration_time_type'] : 'day'; $expired_post_status = isset($form_settings['expiration_settings']['expired_post_status']) ? $form_settings['expiration_settings']['expired_post_status'] : 'draft'; $is_enable_mail_after_expired = isset($form_settings['expiration_settings']['enable_mail_after_expired']) ? 'checked' : ''; $post_expiration_message = isset($form_settings['expiration_settings']['post_expiration_message']) ? $form_settings['expiration_settings']['post_expiration_message'] : ''; ?> <table class="form-table"> <tr> <th><?php _e('Post Expiration', 'wpuf'); ?> </th> <td> <label> <input type="checkbox" id="wpuf-enable_post_expiration" name="wpuf_settings[expiration_settings][enable_post_expiration]" value="on" <?php echo $is_post_exp_selected; ?> /> <?php _e('Enable Post Expiration', 'wpuf'); ?> </label> </td> </tr> <tr class="wpuf_expiration_field"> <th><?php _e('Post Expiration Time', 'wpuf'); ?> </th> <td> <?php $timeType_array = array('year' => 100, 'month' => 12, 'day' => 30); ?> <select name="wpuf_settings[expiration_settings][expiration_time_value]" id="wpuf-expiration_time_value"> <?php for ($i = 1; $i <= $timeType_array[$time_type]; $i++) { ?> <option value="<?php echo $i; ?> " <?php echo $i == $time_value ? 'selected' : ''; ?> ><?php echo $i; ?> </option> <?php } ?> </select> <select name="wpuf_settings[expiration_settings][expiration_time_type]" id="wpuf-expiration_time_type"> <?php foreach ($timeType_array as $each_time_type => $each_time_type_val) { ?> <option value="<?php echo $each_time_type; ?> " <?php echo $each_time_type == $time_type ? 'selected' : ''; ?> ><?php echo ucfirst($each_time_type); ?> </option> <?php } ?> </select> </td> </tr> <tr class="wpuf_expiration_field"> <th> Post Status : </th> <td> <?php $post_statuses = get_post_statuses(); ?> <select name="wpuf_settings[expiration_settings][expired_post_status]" id="wpuf-expired_post_status"> <?php foreach ($post_statuses as $post_status => $text) { ?> <option value="<?php echo $post_status; ?> " <?php echo $expired_post_status == $post_status ? 'selected' : ''; ?> ><?php echo $text; ?> </option> <?php } ?> </select> <p class="description"><?php echo _('Status of post after post expiration time is over '); ?> </p> </td> </tr> <tr class="wpuf_expiration_field"> <th> Send Mail : </th> <td> <label> <input type="checkbox" name="wpuf_settings[expiration_settings][enable_mail_after_expired]" value="on" <?php echo $is_enable_mail_after_expired; ?> /> <?php echo _('Send Email to Author After Exceeding Post Expiration Time'); ?> </label> </td> </tr> <tr class="wpuf_expiration_field"> <th>Post Expiration Message</th> <td> <textarea name="wpuf_settings[expiration_settings][post_expiration_message]" id="wpuf-post_expiration_message" cols="50" rows="5"><?php echo $post_expiration_message; ?> </textarea> </td> </tr> </table> <?php }
function get_statuslist() { return get_post_statuses(); }
function wp_getPostStatusList($args) { $this->escape($args); $blog_id = (int) $args[0]; $username = $args[1]; $password = $args[2]; if (!$this->login_pass_ok($username, $password)) { return new IXR_Error(403, __('Bad login/pass combination.')); } set_current_user(0, $username); if (!current_user_can('edit_posts')) { return new IXR_Error(403, __('You are not allowed access to details about this blog.')); } do_action('xmlrpc_call', 'wp.getPostStatusList'); return get_post_statuses(); }
function get_status_options($field) { $post_type = FrmProForm::post_type($field->form_id); $post_type_object = get_post_type_object($post_type); $options = array(); if (!$post_type_object) { return $options; } $can_publish = current_user_can($post_type_object->cap->publish_posts); $options = get_post_statuses(); //'draft', pending, publish, private if (!$can_publish) { // Contributors only get "Unpublished" and "Pending Review" unset($options['publish']); if (isset($options['future'])) { unset($options['future']); } } return $options; }
function form($pack_id = null) { global $post; $sub_meta = WPUF_Subscription::init()->get_subscription_meta($post->ID, $post); $hidden_recurring_class = $sub_meta['recurring_pay'] != 'yes' ? 'none' : ''; $hidden_trial_class = $sub_meta['trial_status'] != 'yes' ? 'none' : ''; $hidden_expire = $sub_meta['recurring_pay'] == 'yes' ? 'none' : ''; ?> <table class="form-table" style="width: 100%"> <tbody> <input type="hidden" name="wpuf_subscription" id="wpuf_subscription_editor" value="<?php echo wp_create_nonce('wpuf_subscription_editor'); ?> " /> <tr> <th><label><?php _e('Pack Description', 'wpuf'); ?> </label></th> <td> <?php wp_editor($sub_meta['post_content'], 'post_content', array('editor_height' => 100, 'quicktags' => false, 'media_buttons' => false)); ?> </td> </tr> <tr> <th><label for="wpuf-billing-amount"> <span class="wpuf-biling-amount wpuf-subcription-expire" style="display: <?php echo $hidden_expire; ?> ;"><?php _e('Billing amount:', 'wpuf'); ?> </span> <span class="wpuf-billing-cycle wpuf-recurring-child" style="display: <?php echo $hidden_recurring_class; ?> ;"><?php _e('Billing amount each cycle:', 'wpuf'); ?> </span></label></th> <td> <?php echo wpuf_get_option('currency_symbol', 'wpuf_payment', '$'); ?> <input type="text" size="20" style="" id="wpuf-billing-amount" value="<?php echo esc_attr($sub_meta['billing_amount']); ?> " name="billing_amount" /> <div><span class="description"></span></div> </td> </tr> <tr class="wpuf-subcription-expire" style="display: <?php echo $hidden_expire; ?> ;"> <th><label for="wpuf-expiration-number"><?php _e('Expires In:', 'wpuf'); ?> </label></th> <td> <input type="text" size="20" style="" id="wpuf-expiration-number" value="<?php echo esc_attr($sub_meta['expiration_number']); ?> " name="expiration_number" /> <select id="expiration-period" name="expiration_period"> <?php echo $this->option_field($sub_meta['expiration_period']); ?> </select> <div><span class="description"></span></div> </td> </tr> <?php $is_post_exp_selected = isset($sub_meta['_enable_post_expiration']) && $sub_meta['_enable_post_expiration'] == 'on' ? 'checked' : ''; $_post_expiration_time = explode(' ', isset($sub_meta['_post_expiration_time']) ? $sub_meta['_post_expiration_time'] : ' '); $time_value = isset($_post_expiration_time[0]) ? $_post_expiration_time[0] : 1; $time_type = isset($_post_expiration_time[1]) ? $_post_expiration_time[1] : 'day'; $expired_post_status = isset($sub_meta['_expired_post_status']) ? $sub_meta['_expired_post_status'] : ''; $is_enable_mail_after_expired = isset($sub_meta['_enable_mail_after_expired']) && $sub_meta['_enable_mail_after_expired'] == 'on' ? 'checked' : ''; $post_expiration_message = isset($sub_meta['_post_expiration_message']) ? $sub_meta['_post_expiration_message'] : ''; ?> <tr class="wpuf-metabox-post_expiration"> <th><?php _e('Enable Post Expiration', 'wpuf'); ?> </th> <td> <input type="checkbox" id="wpuf-enable_post_expiration" name="post_expiration_settings[enable_post_expiration]" value="on" <?php echo $is_post_exp_selected; ?> /> </td> </tr> <tr class="wpuf-metabox-post_expiration wpuf_expiration_field"> <?php $timeType_array = array('year' => 100, 'month' => 12, 'day' => 30); ?> <th><?php _e('Post Expiration Time', 'wpuf'); ?> </th> <td> <select name="post_expiration_settings[expiration_time_value]" id="wpuf-expiration_time_value"> <?php for ($i = 1; $i <= $timeType_array[$time_type]; $i++) { ?> <option value="<?php echo $i; ?> " <?php echo $i == $time_value ? 'selected' : ''; ?> ><?php echo $i; ?> </option> <?php } ?> </select> <select name="post_expiration_settings[expiration_time_type]" id="wpuf-expiration_time_type"> <?php foreach ($timeType_array as $each_time_type => $each_time_type_val) { ?> <option value="<?php echo $each_time_type; ?> " <?php echo $each_time_type == $time_type ? 'selected' : ''; ?> ><?php echo ucfirst($each_time_type); ?> </option> <?php } ?> </select> </td> </tr> <tr class="wpuf_expiration_field"> <th> Post Status : </th> <td> <?php $post_statuses = get_post_statuses(); ?> <select name="post_expiration_settings[expired_post_status]" id="wpuf-expired_post_status"> <?php foreach ($post_statuses as $post_status => $text) { ?> <option value="<?php echo $post_status; ?> " <?php echo $expired_post_status == $post_status ? 'selected' : ''; ?> ><?php echo $text; ?> </option> <?php } ?> </select> <p class="description"><?php echo _('Status of post after post expiration time is over '); ?> </p> </td> </tr> <tr class="wpuf_expiration_field"> <th> Send Mail : </th> <td> <input type="checkbox" name="post_expiration_settings[enable_mail_after_expired]" value="on" <?php echo $is_enable_mail_after_expired; ?> /> Send Mail to Author After Exceeding Post Expiration Time </td> </tr> <tr class="wpuf_expiration_field"> <th>Post Expiration Message</th> <td> <textarea name="post_expiration_settings[post_expiration_message]" id="wpuf-post_expiration_message" cols="50" rows="5"><?php echo $post_expiration_message; ?> </textarea> </td> </tr> <?php echo $this->get_post_types($sub_meta['post_type_name']); ?> <?php do_action('wpuf_admin_subscription_detail', $sub_meta, $hidden_recurring_class, $hidden_trial_class, $this); ?> </tbody> </table> <?php }
/** * Displays settings on post form builder * * @global object $post */ function form_settings_posts_edit() { global $post; $form_settings = wpuf_get_form_settings($post->ID); $post_status_selected = isset($form_settings['edit_post_status']) ? $form_settings['edit_post_status'] : 'publish'; $redirect_to = isset($form_settings['edit_redirect_to']) ? $form_settings['edit_redirect_to'] : 'same'; $update_message = isset($form_settings['update_message']) ? $form_settings['update_message'] : __('Post updated successfully', 'wpuf'); $page_id = isset($form_settings['edit_page_id']) ? $form_settings['edit_page_id'] : 0; $url = isset($form_settings['edit_url']) ? $form_settings['edit_url'] : ''; $update_text = isset($form_settings['update_text']) ? $form_settings['update_text'] : __('Update', 'wpuf'); $subscription = isset($form_settings['subscription']) ? $form_settings['subscription'] : null; ?> <table class="form-table"> <tr class="wpuf-post-status"> <th><?php _e('Set Post Status to', 'wpuf'); ?> </th> <td> <select name="wpuf_settings[edit_post_status]"> <?php $statuses = get_post_statuses(); foreach ($statuses as $status => $label) { printf('<option value="%s"%s>%s</option>', $status, selected($post_status_selected, $status, false), $label); } printf('<option value="_nochange"%s>%s</option>', selected($post_status_selected, '_nochange', false), __('No Change', 'wpuf')); ?> </select> </td> </tr> <tr class="wpuf-redirect-to"> <th><?php _e('Redirect To', 'wpuf'); ?> </th> <td> <select name="wpuf_settings[edit_redirect_to]"> <?php $redirect_options = array('post' => __('Newly created post', 'wpuf'), 'same' => __('Same Page', 'wpuf'), 'page' => __('To a page', 'wpuf'), 'url' => __('To a custom URL', 'wpuf')); foreach ($redirect_options as $to => $label) { printf('<option value="%s"%s>%s</option>', $to, selected($redirect_to, $to, false), $label); } ?> </select> <p class="description"> <?php _e('After successfull submit, where the page will redirect to', $domain = 'default'); ?> </p> </td> </tr> <tr class="wpuf-same-page"> <th><?php _e('Post Update Message', 'wpuf'); ?> </th> <td> <textarea rows="3" cols="40" name="wpuf_settings[update_message]"><?php echo esc_textarea($update_message); ?> </textarea> </td> </tr> <tr class="wpuf-page-id"> <th><?php _e('Page', 'wpuf'); ?> </th> <td> <select name="wpuf_settings[edit_page_id]"> <?php $pages = get_posts(array('numberposts' => -1, 'post_type' => 'page')); foreach ($pages as $page) { printf('<option value="%s"%s>%s</option>', $page->ID, selected($page_id, $page->ID, false), esc_attr($page->post_title)); } ?> </select> </td> </tr> <tr class="wpuf-url"> <th><?php _e('Custom URL', 'wpuf'); ?> </th> <td> <input type="url" name="wpuf_settings[edit_url]" value="<?php echo esc_attr($url); ?> "> </td> </tr> <tr class="wpuf-subscription-pack" style="display: none;"> <th><?php _e('Subscription Title'); ?> </th> <td> <select id="wpuf-subscription-list" name="wpuf_settings[subscription]"> <?php $this->subscription_dropdown($subscription); ?> </select> </td> </tr> <tr class="wpuf-update-text"> <th><?php _e('Update Post Button text', 'wpuf'); ?> </th> <td> <input type="text" name="wpuf_settings[update_text]" value="<?php echo esc_attr($update_text); ?> "> </td> </tr> </table> <?php }
/** * Status and, if available, publishing time. * * @param int $blog_id * @param WP_Post $remote_post * * @return string */ public function get_remote_post_info($blog_id, WP_Post $remote_post) { $existing_statuses = get_post_statuses(); switch_to_blog($blog_id); $status = get_post_status($remote_post); if (!empty($existing_statuses[$status])) { $translated_status = $existing_statuses[$status]; } else { $translated_status = ucfirst($status); } if (in_array($status, array('publish', 'private'))) { $template = esc_html_x('%1$s (%2$s)', 'No HTML; 1 = post status, 2 = publish time', 'multilingual-press'); $post_time = get_post_time(get_option('date_format'), false, $remote_post); $translated_status = sprintf($template, $translated_status, $post_time); } restore_current_blog(); return $translated_status; }
/** * Print all Backbone templates for form manager * * @since 6.0 */ public function print_templates() { $max_upload_size = wp_max_upload_size(); if (!$max_upload_size) { $max_upload_size = 0; } ?> <script type="text/html" id="ccf-error-modal-template"> <div class="notification-dialog-background"></div> <div class="notification-dialog"> <div class="close">×</div> <div class="message"> <div class="title"><?php esc_html_e('Custom Contact Forms is experiencing issues.', 'custom-contact-forms'); ?> </div> <p> <# if ( 'sync' === messageType ) { #> <p><?php esc_html_e('There is an issue with synchronizing data. Please try the following:', 'custom-contact-forms'); ?> </p> <ul> <li><?php printf(__('Go to Settings > <a href="%s">Permalinks</a> and click "Save Changes". This flushes your permalinks. If this fixes your problem, you are good to go!', 'custom-contact-forms'), esc_url(admin_url('options-permalink.php'))); ?> </li> <li><?php _e('Deactivate all other plugins and activate the TwentySixteen theme. If this fixes the problem, there is a plugin or theme conflict. Please report on <a href="http://github.com/tlovett1/custom-contact-form">Github</a> or the <a href="https://wordpress.org/support/plugin/custom-contact-forms">support forums</a>.', 'custom-contact-forms'); ?> </li> </ul> <p><?php _e('If neither of these things fix your problem, please report on <a href="http://github.com/tlovett1/custom-contact-form">Github</a> or the <a href="https://wordpress.org/support/plugin/custom-contact-forms">support forums</a>.', 'custom-contact-forms'); ?> </p> <# } #> </p> </div> </div> </script> <script type="text/html" id="ccf-main-modal-template"> <div class="wrap"> <a class="close-icon">×</a> <div class="main-menu"> <h1><?php esc_html_e('Manage Forms', 'custom-contact-forms'); ?> </h1> <# if ( ! single ) { #> <ul> <li><a class="selected menu-item" data-view="form-pane" href="#form-pane"><?php esc_html_e('New Form', 'custom-contact-forms'); ?> </a></li> <li><a class="menu-item" data-view="existing-form-pane" href="#existing-form-pane"><?php esc_html_e('Existing Forms', 'custom-contact-forms'); ?> </a></li> </ul> <# } #> </div> <div class="ccf-form-pane <# if ( single ) { #>single<# } #>"></div> <div class="ccf-existing-form-pane"></div> </div> </script> <script type="text/html" id="ccf-field-row-template"> <h4> <span class="right"> <a aria-hidden="true" data-icon="" class="delete"></a> </span> <span class="label">{{ label }}</span> </h4> <div class="preview"></div> </script> <script type="text/html" id="ccf-form-pane-template"> <div class="disabled-overlay"></div> <div class="left-sidebar accordion-container"> <div class="accordion-section expanded"> <a class="accordion-heading"><?php esc_html_e('Standard Fields', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div class="fields draggable-fields"></div> </div> </div> <div class="accordion-section" class="special-fields"> <a class="accordion-heading"><?php esc_html_e('Special Fields', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div class="special-fields draggable-fields"></div> </div> </div> <div class="accordion-section"> <a class="accordion-heading"><?php esc_html_e('Structure', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div class="structure-fields draggable-fields"></div> </div> </div> <div class="accordion-section"> <a class="form-settings-heading"><?php esc_html_e('Form Settings', 'custom-contact-forms'); ?> </a> </div> </div> <div class="ccf-form-settings"></div> <div class="form-content" data-drag-message="<?php esc_html_e('← Drag fields from the left here.', 'custom-contact-forms'); ?> "> </div> <div class="right-sidebar ccf-field-sidebar accordion-container"></div> <div class="bottom"> <?php if (!apply_filters('ccf_hide_ads', false)) { ?> <div class="left signup"> <strong>Want free WP blogging tips, tutorials, and marketing tricks? </strong> <input type="email" class="email-signup-field" placeholder="Email"> <button type="button" class="button signup-button">Sign me up!</button> <span class="signup-check">✓</span> <span class="signup-x">×</span> </div> <?php } ?> <input type="button" class="button insert-form-button" value="<?php esc_html_e('Insert into post', 'custom-contact-forms'); ?> "> <input type="button" class="button button-primary save-button" value="<?php esc_html_e('Save Form', 'custom-contact-forms'); ?> "> <div class="spinner" style="background: url( '<?php echo esc_url(admin_url('images/wpspin_light.gif')); ?> ' ) no-repeat;"></div> </div> </script> <script type="text/html" id="ccf-empty-form-notification-row-template"> <td colspan="4" class="no-notifications"><?php esc_html_e('No notifications yet.', 'custom-contact-forms'); ?> <a class="add"><?php esc_html_e('Add one?', 'custom-contact-forms'); ?> </a></td> </script> <script type="text/html" id="ccf-existing-form-notification-table-row-template"> <# if ( 'view' === context ) { #> <td> <# if ( '' !== notification.title ) { #> {{ notification.title }} <# } else { #> <?php esc_html_e('(Untitled)', 'custom-contact-forms'); ?> <# } #> <div class="actions"> <a class="edit-notification"><?php esc_html_e('Edit', 'custom-contact-forms'); ?> </a> | <a class="delete-notification"><?php esc_html_e('Delete', 'custom-contact-forms'); ?> </a> </div> </td> <td> <# if ( 'default' === notification.subjectType ) { #> <?php echo wp_specialchars_decode(get_bloginfo('name')); ?> : <?php esc_html_e('Form Submission', 'custom-contact-forms'); ?> <# if ( form.title.raw ) { #> <?php esc_html_e('to', 'custom-contact-forms'); ?> {{ form.title.raw }} <# } #> <# } else if ( 'custom' === notification.subjectType ) { #> {{ notification.subject }} <# } else { #> <?php esc_html_e('Pulled from', 'custom-contact-forms'); ?> {{ notification.subjectField }} <# } #> </td> <td> <# if ( ! notification.addresses.length || ( 1 === notification.addresses.length && ! notification.addresses[0].email && ! notification.addresses[0].field ) ) { #> <?php esc_html_e('No One', 'custom-contact-forms'); ?> <# } else { #> <# var i = 0; _.each( notification.addresses, function( address ) { if ( ( 'custom' === address.type && address.email ) || ( 'field' === address.type && address.field ) ) { i++ #> <# if ( i > 1 ) { #> , <# } #> <# if ( 'custom' === address.type ) { #> {{ address.email }} <# } else { #> "{{ address.field }}" <?php esc_html_e('Field', 'custom-contact-forms'); ?> <# } #> <# } } ); #> <# } #> </td> <td> <# if ( notification.active ) { #> <span class="active-indicator">•</span> <# } else { #> <span class="inactive-indicator">•</span> <# } #> </td> <# } else { #> <td colspan="4"> <a class="close-notification">×</a> <div class="left"> <p class="email-notification-name"> <label for="ccf_form_email_notification_title"><?php esc_html_e('Notification Title:', 'custom-contact-forms'); ?> </label> <input class="widefat form-email-notification-title" id="ccf_form_email_notification_title" name="email-notification-title" value="{{ notification.title }}"> </p> <label for="ccf_form_email_notification_content"><?php esc_html_e('Email Content (HTML):', 'custom-contact-forms'); ?> </label> <textarea id="ccf_form_email_notification_content" class="form-email-notification-content">{{ notification.content }}</textarea><br /> <p class="variables"> <strong><?php esc_html_e('Variables:', 'custom-contact-forms'); ?> </strong> [all_fields] [ip_address] [current_date_time] <span class="field-variables"></span> </p> <p class="email-notification-setting"> <label for="ccf_form_email_notification_addresses"><?php esc_html_e('"To" Email Addresses:', 'custom-contact-forms'); ?> </label> <div class="addresses"> </div> </p> <p><em><?php _e('If you are not receiving email notifications, we highly recommend installing the <a href="https://wordpress.org/plugins/easy-wp-smtp/">WP Easy SMTP</a> plugin as there is probably an issue with emailing on your host.', 'custom-contact-forms'); ?> </em></p> </div> <div class="right"> <p class="email-notification-active"> <label for="ccf_form_email_notification_active"><strong><?php esc_html_e('Activate Notification:', 'custom-contact-forms'); ?> </strong></label> <select name="email_notification_active" class="form-email-notification-active" id="ccf_form_email_notification_active"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( notification.active ) { #>selected<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> <span class="explain"><?php esc_html_e('Only active notifications will be sent.', 'custom-contact-forms'); ?> </span> </p> <p class="email-notification-setting"> <label for="ccf_form_email_notification_from_type"><?php esc_html_e('"From" Email Address Type:', 'custom-contact-forms'); ?> </label> <select name="email_notification_from_type" class="form-email-notification-from-type" id="ccf_form_email_notification_from_type"> <option value="default"><?php esc_html_e('WordPress Default', 'custom-contact-forms'); ?> </option> <option value="custom" <# if ( 'custom' === notification.fromType ) { #>selected<# } #>><?php esc_html_e('Custom Email', 'custom-contact-forms'); ?> </option> <option value="field" <# if ( 'field' === notification.fromType ) { #>selected<# } #>><?php esc_html_e('Form Field', 'custom-contact-forms'); ?> </option> </select> <span class="explain"><?php esc_html_e('You can set the notification emails from address to be the WP default, a custom email address, or pull the address from a field in the form.', 'custom-contact-forms'); ?> </span> </p> <p class="email-notification-from-address"> <label for="ccf_form_email_notification_from_address"><?php esc_html_e('Custom "From" Email Address:', 'custom-contact-forms'); ?> </label> <input class="widefat form-email-notification-from-address" id="ccf_form_email_notification_from_address" name="email-notification-from-address" value="{{ notification.fromAddress }}"> </p> <p class="email-notification-from-field"> <label for="ccf_form_email_notification_from_field"><?php esc_html_e('Pull "From" Email Dynamically from Field:', 'custom-contact-forms'); ?> </label> <select name="email_notification_from_field" class="form-email-notification-from-field" id="ccf_form_email_notification_from_field"> </select> </p> <p class="email-notification-setting"> <label for="ccf_form_email_notification_from_name_type"><?php esc_html_e('"From" Name Type:', 'custom-contact-forms'); ?> </label> <select name="email_notification_from_name_type" class="form-email-notification-from-name-type" id="ccf_form_email_notification_from_name_type"> <option value="custom"><?php esc_html_e('Custom Name', 'custom-contact-forms'); ?> </option> <option value="field" <# if ( 'field' === notification.fromNameType ) { #>selected<# } #>><?php esc_html_e('Form Field', 'custom-contact-forms'); ?> </option> </select> <span class="explain"><?php esc_html_e('You can set the notification emails from name to be a custom name or pull the name from a field in the form.', 'custom-contact-forms'); ?> </span> </p> <p class="email-notification-from-name"> <label for="ccf_form_email_notification_from_name"><?php esc_html_e('Custom "From" Name:', 'custom-contact-forms'); ?> </label> <input class="widefat form-email-notification-from-name" id="ccf_form_email_notification_from_name" name="email-notification-from-name" value="{{ notification.fromName }}"> </p> <p class="email-notification-from-name-field"> <label for="ccf_form_email_notification_from_name_field"><?php esc_html_e('Pull "From" Name Dynamically from Field:', 'custom-contact-forms'); ?> </label> <select name="email_notification_from_name_field" class="form-email-notification-from-name-field" id="ccf_form_email_notification_from_name_field"> </select> </p> <p class="email-notification-setting"> <label for="ccf_form_email_notification_subject_type"><?php esc_html_e('Email Subject Type:', 'custom-contact-forms'); ?> </label> <select name="email_notification_subject_type" class="form-email-notification-subject-type" id="ccf_form_email_notification_subject_type"> <option value="default"><?php esc_html_e('Default', 'custom-contact-forms'); ?> </option> <option value="custom" <# if ( 'custom' === notification.subjectType ) { #>selected<# } #>><?php esc_html_e('Custom Subject', 'custom-contact-forms'); ?> </option> <option value="field" <# if ( 'field' === notification.subjectType ) { #>selected<# } #>><?php esc_html_e('Form Field', 'custom-contact-forms'); ?> </option> </select> <span class="explain"><?php esc_html_e('You can set the notification emails subject line to be the CCF default, custom text, or pull the subject from a field in the form.', 'custom-contact-forms'); ?> </span> </p> <p class="email-notification-subject"> <label for="ccf_form_email_notification_subject"><?php esc_html_e('Custom Email Subject:', 'custom-contact-forms'); ?> </label> <input class="widefat form-email-notification-subject" id="ccf_form_email_notification_subject" name="email-notification-subject" value="{{ notification.subject }}"> </p> <p class="email-notification-subject-field"> <label for="ccf_form_email_notification_subject_field"><?php esc_html_e('Pull Email Subject Dynamically from Field:', 'custom-contact-forms'); ?> </label> <select name="email_notification_subject_field" class="form-email-notification-subject-field" id="ccf_form_email_notification_subject_field"> </select> </p> </div> </td> <# } #> </script> <script type="text/html" id="ccf-form-notification-address-template"> <select name="form_notification_address_type" class="form-notification-address-type" id="ccf_form_notification_address_type"> <option value="custom"><?php esc_html_e('Custom Email', 'custom-contact-forms'); ?> </option> <option value="field" <# if ( 'field' === address.type ) { #>selected<# } #>><?php esc_html_e('Form Field', 'custom-contact-forms'); ?> </option> </select> <# if ( 'custom' === address.type ) { #> <input class="form-notification-address-email" type="text" placeholder="<?php esc_html_e('Email', 'custom-contact-forms'); ?> " value="{{ address.email }}"> <# } else if ( 'field' === address.type ) { #> <select name="form_notification_address_field" class="form-notification-address-field" id="ccf_form_notification_address_field"></select> <# } #> <a aria-hidden="true" data-icon="" class="add"></a> <a aria-hidden="true" data-icon="" class="delete"></a> </script> <script type="text/html" id="ccf-form-settings-template"> <h3><?php esc_html_e('General', 'custom-contact-forms'); ?> </h3> <p> <label for="ccf_form_title"><?php esc_html_e('Form Title:', 'custom-contact-forms'); ?> </label> <input class="widefat form-title" id="ccf_form_title" name="title" type="text" value="{{ form.title.raw }}"> </p> <p> <label for="ccf_form_description"><?php esc_html_e('Form Description:', 'custom-contact-forms'); ?> </label> <textarea class="widefat form-description" id="ccf_form_description" name="description">{{ form.description }}</textarea> </p> <p> <label for="ccf_form_button_text"><?php esc_html_e('Button Text:', 'custom-contact-forms'); ?> </label> <input class="widefat form-button-text" id="ccf_form_button_text" name="text" type="text" value="{{ form.buttonText }}"> </p> <p> <label for="ccf_form_button_class"><?php esc_html_e('Button Class:', 'custom-contact-forms'); ?> </label> <input class="widefat form-button-class" id="ccf_form_button_class" name="class" type="text" value="{{ form.buttonClass }}"> </p> <p> <label for="ccf_form_theme"><?php esc_html_e('Form Theme:', 'custom-contact-forms'); ?> </label> <select name="theme" class="form-theme" id="ccf_form_theme"> <option value=""><?php esc_html_e('None', 'custom-contact-forms'); ?> </option> <option value="light" <# if ( 'light' === form.theme ) { #>selected<# } #>><?php esc_html_e('Light', 'custom-contact-forms'); ?> </option> <option value="dark" <# if ( 'dark' === form.theme ) { #>selected<# } #>><?php esc_html_e('Dark', 'custom-contact-forms'); ?> </option> </select> <span class="explain"><?php esc_html_e('"None" will have your form inherit styles from your theme.', 'custom-contact-forms'); ?> </span> </p> <p> <label for="ccf_form_completion_action_type"><?php esc_html_e('On form completion:', 'custom-contact-forms'); ?> </label> <select name="completion_action_type" class="form-completion-action-type" id="ccf_form_completion_action_type"> <option value="text"><?php esc_html_e('Show text', 'custom-contact-forms'); ?> </option> <option value="redirect" <# if ( 'redirect' === form.completionActionType ) { #>selected<# } #>><?php esc_html_e('Redirect', 'custom-contact-forms'); ?> </option> </select> </p> <p class="completion-redirect-url"> <label for="ccf_form_completion_redirect_url"><?php esc_html_e('Redirect URL:', 'custom-contact-forms'); ?> </label> <input class="widefat form-completion-redirect-url" id="ccf_form_completion_redirect_url" name="text" type="text" value="{{ form.completionRedirectUrl }}"> </p> <p class="completion-message"> <label for="ccf_form_completion_message"><?php esc_html_e('Completion Message:', 'custom-contact-forms'); ?> </label> <textarea class="widefat form-completion-message" id="ccf_form_completion_message" name="completion-message">{{ form.completionMessage }}</textarea> </p> <p> <label for="ccf_form_pause"><?php esc_html_e('Pause form:', 'custom-contact-forms'); ?> </label> <select name="form_pause" class="form-pause" id="ccf_form_pause"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( form.pause ) { #>selected<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </p> <p class="pause-message"> <label for="ccf_form_pause_message"><?php esc_html_e('Pause Message:', 'custom-contact-forms'); ?> </label> <textarea class="widefat form-pause-message" id="ccf_form_pause_message" name="pause-message">{{ form.pauseMessage }}</textarea> </p> <h3><?php esc_html_e('Email Notifications', 'custom-contact-forms'); ?> </h3> <div class="ccf-form-notifications"> <table cellpadding="0" cellspacing="0"> <thead> <tr> <th class="name"><?php esc_html_e('Title', 'custom-contact-forms'); ?> </th> <th class="subject"><?php esc_html_e('Subject', 'custom-contact-forms'); ?> </th> <th class="to"><?php esc_html_e('To', 'custom-contact-forms'); ?> </th> <th class="active"><?php esc_html_e('Active', 'custom-contact-forms'); ?> </th> </tr> </thead> <tbody class="rows"> </tbody> <tfoot> <tr> <th class="name"><?php esc_html_e('Title', 'custom-contact-forms'); ?> </th> <th class="subject"><?php esc_html_e('Subject', 'custom-contact-forms'); ?> </th> <th class="to"><?php esc_html_e('To', 'custom-contact-forms'); ?> </th> <th class="active"><?php esc_html_e('Active', 'custom-contact-forms'); ?> </th> </tr> </tfoot> </table> <a class="add-notification button"><?php esc_html_e('New Notification', 'custom-contact-forms'); ?> </a> <p> <span class="explain"><?php esc_html_e('For notification changes to take affect (updating, adding, deleting, etc.), you will need to save the form.', 'custom-contact-forms'); ?> </span> </p> </div> <h3><?php esc_html_e('Post Creation', 'custom-contact-forms'); ?> </h3> <p><?php esc_html_e('You can have Custom Contact Forms create a post (or custom post type) whenever someone submits your form.', 'custom-contact-forms'); ?> </p> <p> <label for="ccf_form_post_creation"><?php esc_html_e('Enable Post Creation:', 'custom-contact-forms'); ?> </label> <select name="form_post_creation" class="form-post-creation" id="ccf_form_post_creation"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( form.postCreation ) { #>selected<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </p> <p class="post-creation-mapping-field"> <label for="ccf_form_post_creation_type"><?php esc_html_e('Post Type:', 'custom-contact-forms'); ?> </label> <select name="form_post_creation_type" class="form-post-creation-type" id="ccf_form_post_creation_type"> <?php $post_types = get_post_types(array(), 'objects'); foreach ($post_types as $post_type) { ?> <option <# if ( '<?php echo esc_attr($post_type->name); ?> ' === form.postCreationType ) { #>selected<# } #> value="<?php echo esc_attr($post_type->name); ?> "><?php echo esc_html($post_type->name); ?> </option> <?php } ?> </select> </p> <p class="post-creation-mapping-field"> <label for="ccf_form_post_creation_status"><?php esc_html_e('Post Status:', 'custom-contact-forms'); ?> </label> <select name="form_post_creation_status" class="form-post-creation-status" id="ccf_form_post_creation_status"> <?php $post_statuses = get_post_statuses(); foreach ($post_statuses as $post_status => $post_status_name) { ?> <option <# if ( '<?php echo esc_attr($post_status); ?> ' === form.postCreationStatus ) { #>selected<# } #> value="<?php echo esc_attr($post_status); ?> "><?php echo esc_html($post_status_name); ?> </option> <?php } ?> </select> </p> <div class="post-creation-mapping-field post-creation-mapping-wrapper"> <label for="ccf_form_post_creation_type"><?php esc_html_e('Field Mappings:', 'custom-contact-forms'); ?> </label> <div class="post-creation-mapping"> </div> <span class="explain"><?php esc_html_e('You can map as few or as many fields as you like. However, if no form fields are mapped, no post will be created. Mapping a field to post_title is required.', 'custom-contact-forms'); ?> </span> </div> </script> <script type="text/html" id="ccf-post-field-mapping"> <select id="ccf_post_field_mapping_form_field" class="field-form-field"> </select> <select id="ccf_post_field_mapping_post_field" class="field-post-field"> </select> <# if ( 'custom_field' === mapping.postField ) { #> <input class="field-custom-field-key" type="text" placeholder="<?php esc_html_e('Custom Field Key', 'custom-contact-forms'); ?> " value="{{ mapping.customFieldKey }}"> <# } #> <a aria-hidden="true" data-icon="" class="add"></a> <a aria-hidden="true" data-icon="" class="delete"></a> </script> <script type="text/html" id="ccf-existing-form-pane-template"> <div class="ccf-existing-form-table"></div> </script> <script type="text/html" id="ccf-pagination-template"> <span class="num-items">{{ totalObjects }} <?php esc_html_e('items', 'custom-contact-forms'); ?> </span> <a class="first <# if ( currentPage <= 1 ) { #>disabled<# } #>">«</a> <a class="prev <# if ( currentPage <= 1 ) { #>disabled<# } #>">‹</a> <span class="pages">{{ currentPage }} of {{ totalPages }}</span> <a class="next <# if ( currentPage >= totalPages ) { #>disabled<# } #>">›</a> <a class="last <# if ( currentPage >= totalPages ) { #>disabled<# } #>">»</a> </script> <script type="text/html" id="ccf-existing-form-table-template"> <table cellspacing="0" cellpadding="0"> <thead> <tr> <th class="id"><?php esc_html_e('ID', 'custom-contact-forms'); ?> </th> <th class="title"><?php esc_html_e('Title', 'custom-contact-forms'); ?> </th> <th class="date"><?php esc_html_e('Date', 'custom-contact-forms'); ?> </th> <th class="author"><?php esc_html_e('Author', 'custom-contact-forms'); ?> </th> <th class="number-of-fields"><?php esc_html_e('Number of Fields', 'custom-contact-forms'); ?> </th> <th class="submissions"><?php esc_html_e('Submissions', 'custom-contact-forms'); ?> </th> </tr> </thead> <tbody class="rows"> </tbody> <tfoot> <tr> <th class="id"><?php esc_html_e('ID', 'custom-contact-forms'); ?> </th> <th class="title"><?php esc_html_e('Title', 'custom-contact-forms'); ?> </th> <th class="date"><?php esc_html_e('Date', 'custom-contact-forms'); ?> </th> <th class="author"><?php esc_html_e('Author', 'custom-contact-forms'); ?> </th> <th class="submissions"><?php esc_html_e('Number of Fields', 'custom-contact-forms'); ?> </th> <th class="submission"><?php esc_html_e('Submissions', 'custom-contact-forms'); ?> </th> </tr> </tfoot> </table> <div class="ccf-pagination"></div> </script> <script type="text/html" id="ccf-empty-field-template"> <div class="no-field"> <?php _e('<span>←</span> Click on a field to edit it.', 'custom-contact-forms'); ?> </div> </script> <script type="text/html" id="ccf-single-line-text-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading">Basic</a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug', 'custom-contact-forms'); ?> (a-z, 0-9, -, _):</label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-placeholder"><?php esc_html_e('Placeholder Text:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-file-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading">Basic</a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug', 'custom-contact-forms'); ?> (a-z, 0-9, -, _):</label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-file-extensions"><?php esc_html_e('Allowed File Extensions (comma separate):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-file-extensions" class="field-file-extensions" type="text" value="{{ field.fileExtensions }}"> <span class="explain"><?php _e('If left blank, will default to all extensions registered by WordPress. If you use a file extension or mime type not <a href="http://codex.wordpress.org/Function_Reference/get_allowed_mime_types">whitelisted by WordPress</a>, you will need to filter and manually whitelist the new extension.', 'custom-contact-forms'); ?> </span> </div> <div> <label for="ccf-field-max-file-size"><?php esc_html_e('Max File Size (in MB):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-max-file-size" class="field-max-file-size" type="text" value="{{ field.maxFileSize }}"> <span class="explain"><?php printf(esc_html__('If left blank, will default to %d MB. Maximum allowed by server is %d MB.', 'custom-contact-forms'), (double) size_format($max_upload_size), (double) size_format($max_upload_size)); ?> </span> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-recaptcha-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading">Basic</a> <div class="section-content"> <p><?php _e('reCAPTCHA is a simple captcha service provided by Google. <a target="_blank" href="https://www.google.com/recaptcha/intro/index.html">Learn more</a>', 'custom-contact-forms'); ?> </p> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-site-key"><span class="required">*</span> <?php esc_html_e('Site Key:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-site-key" class="field-site-key" type="text" value="{{ field.siteKey }}"> <a href="http://google.com/recaptcha/" target="_blank"><?php _e("Don't have one?", 'custom-contact-forms'); ?> </a> </div> <div> <label for="ccf-field-secret-key"><span class="required">*</span> <?php esc_html_e('Secret Key:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-secret-key" class="field-secret-key" type="text" value="{{ field.secretKey }}"> <a href="http://google.com/recaptcha/" target="_blank"><?php _e("Don't have one?", 'custom-contact-forms'); ?> </a> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-website-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading">Basic</a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug', 'custom-contact-forms'); ?> (a-z, 0-9, -, _):</label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-placeholder"><?php esc_html_e('Placeholder Text:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-html-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-html"><?php esc_html_e('HTML Content:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-html" class="field-html">{{ field.html }}</textarea> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-section-header-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-heading"><?php esc_html_e('Heading:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-heading" class="field-heading" type="text" value="{{ field.heading }}"> </div> <div> <label for="ccf-field-subheading"><?php esc_html_e('Sub Heading:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-subheading" class="field-subheading" type="text">{{ field.subheading }}</textarea> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-paragraph-text-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug', 'custom-contact-forms'); ?> (a-z, 0-9, -, _):</label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-placeholder"><?php esc_html_e('Placeholder Text:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-hidden-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-name-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-date-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <# if ( ! field.showTime ) { #> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> <# } #> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> <div> <input type="checkbox" <# if ( field.showDate ) { #>checked="checked"<# } #> class="field-show-date" value="1" id="ccf-field-show-date"> <label for="ccf-field-show-date"><?php esc_html_e('Enable Date Select', 'custom-contact-forms'); ?> </label> </div> <div> <input type="checkbox" <# if ( field.showTime ) { #>checked="checked"<# } #> class="field-show-time" value="1" id="ccf-field-show-time"> <label for="ccf-field-show-time"><?php esc_html_e('Enable Time Select', 'custom-contact-forms'); ?> </label> </div> <# if ( field.showDate ) { #> <div> <label for="ccf-date-format"><?php esc_html_e('Date Format:', 'custom-contact-forms'); ?> </label> <select id="ccf-date-format" class="field-date-format"> <option value="mm/dd/yyyy">mm/dd/yyyy</option> <option <# if ( 'dd/mm/yyyy' === field.dateFormat ) { #>selected="selected"<# } #>>dd/mm/yyyy</option> </select> </div> <# } #> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <# if ( ! ( field.showTime && field.showDate ) ) { #> <div> <label for="ccf-field-placeholder"><?php esc_html_e('Placeholder Text:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}"> </div> <# } #> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-phone-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> <div> <label for="ccf-field-phone-format"><?php esc_html_e('Format:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-phone-format" class="field-phone-format"> <option value="us">(xxx) xxx-xxxx</option> <option value="international" <# if ( 'international' === field.phoneFormat ) { #>selected="selected"<# } #>><?php esc_html_e('International', 'custom-contact-forms'); ?> </option> </select> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-placeholder"><?php esc_html_e('Placeholder Text:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-address-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-address-type"><?php esc_html_e('Type:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-address-type" class="field-address-type"> <option value="us"><?php esc_html_e('United States', 'custom-contact-forms'); ?> </option> <option value="international" <# if ( 'international' === field.addressType ) { #>selected="selected"<# } #>><?php esc_html_e('International', 'custom-contact-forms'); ?> </option> </select> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-email-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <# if ( ! field.emailConfirmation ) { #> <div> <label for="ccf-field-value"><?php esc_html_e('Initial Value:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-value" class="field-value" type="text" value="{{ field.value }}"> </div> <# } #> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> <div> <label for="ccf-field-email-confirmation"><?php esc_html_e('Require Confirmation:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-email-confirmation" class="field-email-confirmation"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.emailConfirmation ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <# if ( ! field.emailConfirmation ) { #> <div> <label for="ccf-field-placeholder"><?php esc_html_e('Placeholder Text:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-placeholder" class="field-placeholder" type="text" value="{{ field.placeholder }}"> </div> <# } #> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-field-choice-template"> <a aria-hidden="true" data-icon="" class="move"></a> <input class="choice-selected" <# if ( choice.selected ) { #>checked<# } #> name="selected" type="checkbox" value="1"> <input class="choice-label" type="text" placeholder="<?php esc_html_e('Label', 'custom-contact-forms'); ?> " value="{{ choice.label }}"> <input class="choice-value" type="text" placeholder="<?php esc_html_e('Value', 'custom-contact-forms'); ?> " value="{{ choice.value }}"> <a aria-hidden="true" data-icon="" class="add"></a> <a aria-hidden="true" data-icon="" class="delete"></a> </script> <script type="text/html" id="ccf-field-conditional-template"> <a aria-hidden="true" data-icon="" class="add"></a> <a aria-hidden="true" data-icon="" class="delete"></a> <select class="conditional-field"> </select> <select class="conditional-compare"> <option <# if ( 'is' === conditional.compare ) { #>selected<# } #> value="is"><?php esc_html_e('is', 'custom-contact-forms'); ?> </option> <option <# if ( 'is-not' === conditional.compare ) { #>selected<# } #> value="is-not"><?php esc_html_e('is not', 'custom-contact-forms'); ?> </option> <option <# if ( 'greater-than' === conditional.compare ) { #>selected<# } #> value="greater-than"><?php esc_html_e('>', 'custom-contact-forms'); ?> </option> <option <# if ( 'less-than' === conditional.compare ) { #>selected<# } #> value="less-than"><?php esc_html_e('<', 'custom-contact-forms'); ?> </option> <option <# if ( 'contains' === conditional.compare ) { #>selected<# } #> value="contains"><?php esc_html_e('contains', 'custom-contact-forms'); ?> </option> </select> <input class="conditional-value" placeholder="<?php esc_attr_e('Field value', 'custom-contact-forms'); ?> " type="text" value="{{ conditional.value }}"> </script> <script type="text/html" id="ccf-dropdown-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> <div> <label><?php esc_html_e('Manage field choices:', 'custom-contact-forms'); ?> </label> <div class="repeatable-choices"> </div> <p><?php esc_html_e("Note: If an option does not have a \"value\", it will not be considered a valid selection if the field is required. The \"value\" is what's read, stored, and displayed in the submission.", 'custom-contact-forms'); ?> </p> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-radio-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> <div> <label><?php esc_html_e('Manage field choices:', 'custom-contact-forms'); ?> </label> <div class="repeatable-choices"> </div> <p><?php esc_html_e("Note: If an option does not have a \"value\", it will not be considered a valid selection if the field is required. The \"value\" is what's read, stored, and displayed in the submission.", 'custom-contact-forms'); ?> </p> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-checkboxes-template"> <div class="accordion-section <# if ( 'basic' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Basic', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-slug"><span class="required">*</span> <?php esc_html_e('Internal Unique Slug (a-z, 0-9, -, _):', 'custom-contact-forms'); ?> </label> <input id="ccf-field-slug" class="field-slug" type="text" value="{{ field.slug }}"> </div> <div> <label for="ccf-field-label"><?php esc_html_e('Label:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-label" class="field-label" type="text" value="{{ field.label }}"> </div> <div> <label for="ccf-field-description"><?php esc_html_e('Description:', 'custom-contact-forms'); ?> </label> <textarea id="ccf-field-description" class="field-description">{{ field.description }}</textarea> </div> <div> <label for="ccf-field-required"><?php esc_html_e('Required:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-required" class="field-required"> <option value="1"><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> <option value="0" <# if ( ! field.required ) { #>selected="selected"<# } #>><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> </select> </div> <div> <label><?php esc_html_e('Manage field choices:', 'custom-contact-forms'); ?> </label> <div class="repeatable-choices"> </div> <p><?php esc_html_e("Note: If an option does not have a \"value\", it will not be considered a valid selection if the field is required. The \"value\" is what's read, stored, and displayed in the submission.", 'custom-contact-forms'); ?> </p> </div> </div> </div> <div class="accordion-section <# if ( 'advanced' === startPanel ) { #>expanded<# } #>"> <a class="accordion-heading"><?php esc_html_e('Advanced', 'custom-contact-forms'); ?> </a> <div class="section-content"> <div> <label for="ccf-field-class-name"><?php esc_html_e('Class Name:', 'custom-contact-forms'); ?> </label> <input id="ccf-field-class-name" class="field-class-name" type="text" value="{{ field.className }}"> </div> <div> <label for="ccf-field-conditionals-enabled"><?php esc_html_e('Enable Conditional Logic:', 'custom-contact-forms'); ?> </label> <select id="ccf-field-conditionals-enabled" class="field-conditionals-enabled"> <option value="0"><?php esc_html_e('No', 'custom-contact-forms'); ?> </option> <option value="1" <# if ( field.conditionalsEnabled ) { #>selected="selected"<# } #>><?php esc_html_e('Yes', 'custom-contact-forms'); ?> </option> </select> </div> <div class="<# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> <select class="field-conditional-type"> <option value="hide"><?php esc_html_e('Hide', 'custom-contact-forms'); ?> </option> <option <# if ( 'show' === field.conditionalType ) { #>selected="selected"<# } #> value="show"><?php esc_html_e('Show', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('this field if', 'custom-contact-forms'); ?> <select class="field-conditional-fields-required"> <option value="all"><?php esc_html_e('All', 'custom-contact-forms'); ?> </option> <option <# if ( 'any' === field.conditionalFieldsRequired ) { #>selected="selected"<# } #> value="any"><?php esc_html_e('Any', 'custom-contact-forms'); ?> </option> </select> <?php esc_html_e('of these conditions are true:', 'custom-contact-forms'); ?> </div> <div class="conditionals <# if ( ! field.conditionalsEnabled ) { #>hide<# } #>"> </div> </div> </div> </script> <script type="text/html" id="ccf-empty-form-table-row-template"> <td class="empty-form-table" colspan="6"> <?php esc_html_e('You currently have no forms. Add some!', 'custom-contact-forms'); ?> </td> </script> <script type="text/html" id="ccf-single-line-text-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <input disabled type="text" placeholder="{{ field.placeholder }}" value="{{ field.value }}"> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-file-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <input disabled type="file" placeholder="{{ field.placeholder }}" value="{{ field.value }}"> <div class="field-description"> <# if ( field.fileExtensions ) { var extensions = field.fileExtensions.toLowerCase().replace( /\s/g, '' ).split( ',' ).join( ', ' ); var file_size = <?php echo floor($max_upload_size / 1000 / 1000); ?> ; if ( field.maxFileSize ) { file_size = field.maxFileSize; } #> <?php esc_html_e('Allowed file extensions are {{ extensions }}. ', 'custom-contact-forms'); ?> <# } #> <?php esc_html_e('Max file size is {{ file_size }} MB. ', 'custom-contact-forms'); ?> {{ field.description }} </div> </script> <script type="text/html" id="ccf-recaptcha-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <img class="recaptcha-preview-img" src="<?php echo plugins_url('img/recaptcha.png', dirname(__FILE__)); ?> "> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-paragraph-text-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <textarea placeholder="{{ field.placeholder }}" disabled>{{ field.value }}</textarea> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-dropdown-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <select> <# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #> <option><?php esc_html_e('An example choice', 'custom-contact-forms'); ?> </option> <#} else { #> <# field.choices.each( function( choice ) { #> <option <# if ( choice.get( 'selected' ) ) { #>selected<# } #> value="{{ choice.get( 'value' ) }}">{{ choice.get( 'label' ) }}</option> <# }); #> <# } #> </select> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-radio-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #> <div> <input type="radio" value="1" checked="checked"> <label><?php esc_html_e('An example choice', 'custom-contact-forms'); ?> </label> </div> <#} else { #> <# field.choices.each( function( choice ) { #> <div class="choice"> <input type="radio" value="{{ choice.get( 'value' ) }}" <# if ( choice.get( 'selected' ) ) { #>checked="checked"<# } #>> <label>{{ choice.get( 'label' ) }}</label> </div> <# }); #> <# } #> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-checkboxes-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <# if ( field.choices.length === 0 || ( field.choices.length === 1 && ! field.choices.at( 0 ).get( 'label' ) && ! field.choices.at( 0 ).get( 'value' ) ) ) { #> <div> <input type="checkbox" value="1" checked="checked"> <label><?php esc_html_e('An example choice', 'custom-contact-forms'); ?> </label> </div> <#} else { #> <# field.choices.each( function( choice ) { #> <div class="choice"> <input type="checkbox" value="{{ choice.get( 'value' ) }}" <# if ( choice.get( 'selected' ) ) { #>checked="checked"<# } #>> <label>{{ choice.get( 'label' ) }}</label> </div> <# }); #> <# } #> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-html-preview-template"> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #> <# if ( typeof mce !== 'undefined' ) { #> {{{ field.html }}} <# } else { #> <pre><pre><?php esc_html_e('Arbitrary block of HTML.', 'custom-contact-forms'); ?> </pre></pre> <# } #> </script> <script type="text/html" id="ccf-section-header-preview-template"> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #> <div class="heading"> <# if ( field.heading ) { #>{{ field.heading }}<# } else { #><?php esc_html_e('Section Heading', 'custom-contact-forms'); ?> <# } #> </div> <div class="subheading"><# if ( field.subheading ) { #>{{ field.subheading }}<# } else { #><?php esc_html_e('This is the sub-heading text.', 'custom-contact-forms'); ?> <# } #></div> </script> <script type="text/html" id="ccf-name-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <div class="left"> <input type="text"> <label class="sub-label"><?php esc_html_e('First', 'custom-contact-forms'); ?> </label> </div> <div class="right"> <input type="text"> <label class="sub-label"><?php esc_html_e('Last', 'custom-contact-forms'); ?> </label> </div> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-date-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <# if ( field.showDate && ! field.showTime ) { #> <input value="{{ field.value }}" class="ccf-datepicker" disabled type="text"> <# } else if ( ! field.showDate && field.showTime ) { #> <div class="full"> <div class="hour"> <input type="text"> <label class="sub-label"><?php esc_html_e('HH', 'custom-contact-forms'); ?> </label> </div> <div class="minute"> <input type="text"> <label class="sub-label"><?php esc_html_e('MM', 'custom-contact-forms'); ?> </label> </div> <div class="am-pm"> <select> <option value="am"><?php esc_html_e('AM', 'custom-contact-forms'); ?> </option> <option value="pm"><?php esc_html_e('PM', 'custom-contact-forms'); ?> </option> </select> </div> </div> <# } else { #> <div class="left"> <input class="ccf-datepicker" disabled type="text"> <label class="sub-label"><?php esc_html_e('Date', 'custom-contact-forms'); ?> </label> </div> <div class="right"> <div class="hour"> <input type="text"> <label class="sub-label"><?php esc_html_e('HH', 'custom-contact-forms'); ?> </label> </div> <div class="minute"> <input type="text"> <label class="sub-label"><?php esc_html_e('MM', 'custom-contact-forms'); ?> </label> </div> <div class="am-pm"> <select> <option value="am"><?php esc_html_e('AM', 'custom-contact-forms'); ?> </option> <option value="pm"><?php esc_html_e('PM', 'custom-contact-forms'); ?> </option> </select> </div> </div> <# } #> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-address-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <# if ( field.addressType === 'us' ) { #> <div class="full"> <input type="text"> <label class="sub-label"><?php esc_html_e('Street Address', 'custom-contact-forms'); ?> </label> </div> <div class="full"> <input type="text"> <label class="sub-label"><?php esc_html_e('Address Line 2', 'custom-contact-forms'); ?> </label> </div> <div class="left"> <input type="text"> <label class="sub-label"><?php esc_html_e('City', 'custom-contact-forms'); ?> </label> </div> <div class="right"> <select> <?php foreach (CCF_Constants::factory()->get_us_states() as $state) { ?> <option><?php echo $state; ?> </option> <?php } ?> </select> <label class="sub-label"><?php esc_html_e('State', 'custom-contact-forms'); ?> </label> </div> <div class="left"> <input type="text"> <label class="sub-label"><?php esc_html_e('ZIP Code', 'custom-contact-forms'); ?> </label> </div> <# } else if ( field.addressType === 'international' ) { #> <div class="full"> <input type="text"> <label class="sub-label"><?php esc_html_e('Street Address', 'custom-contact-forms'); ?> </label> </div> <div class="full"> <input type="text"> <label class="sub-label"><?php esc_html_e('Address Line 2', 'custom-contact-forms'); ?> </label> </div> <div class="left"> <input type="text"> <label class="sub-label"><?php esc_html_e('City', 'custom-contact-forms'); ?> </label> </div> <div class="right"> <input type="text"> <label class="sub-label"><?php esc_html_e('State / Region / Province', 'custom-contact-forms'); ?> </label> </div> <div class="left"> <input type="text"> <label class="sub-label"><?php esc_html_e('ZIP / Postal Code', 'custom-contact-forms'); ?> </label> </div> <div class="right"> <select> <?php foreach (CCF_Constants::factory()->get_countries() as $country) { ?> <option><?php echo $country; ?> </option> <?php } ?> </select> <label class="sub-label"><?php esc_html_e('Country', 'custom-contact-forms'); ?> </label> </div> <# } #> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-email-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <# if ( ! field.emailConfirmation ) { #> <input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else { #><?php esc_html_e('*****@*****.**', 'custom-contact-forms'); ?> <# } #>" disabled type="text" value="{{ field.value }}"> <# } else { #> <div class="left"> <input type="text"> <div class="sub-label"><?php esc_html_e('Email', 'custom-contact-forms'); ?> </div> </div> <div class="right"> <input type="text"> <div class="sub-label"><?php esc_html_e('Confirm Email', 'custom-contact-forms'); ?> </div> </div> <# } #> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-website-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else { #>http://<# } #>" disabled type="text" value="{{ field.value }}"> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-phone-preview-template"> <label>{{ field.label }} <# if ( field.required ) { #><span class="required">*</span><# } #> <# if ( field.conditionalsEnabled ) { #><span class="conditionals-enabled">if</span><# } #></label> <input placeholder="<# if ( field.placeholder ) { #>{{ field.placeholder }}<# } else if ( 'us' === field.phoneFormat ) { #>(301) 101-8976<# } #>" disabled type="text" value="{{ field.value }}"> <# if ( field.description ) { #> <div class="field-description">{{ field.description }}</div> <# } #> </script> <script type="text/html" id="ccf-existing-form-table-row-template"> <td>{{ form.id }}</td> <td> <a class="edit edit-form title" data-view="form-pane" data-form-id="{{ form.id }}" href="#form-pane-{{ form.id }}"><# if ( form.title.raw ) { #>{{ form.title.raw }}<# } else { #>{{ '<?php esc_html_e('(No title)', 'custom-contact-forms'); ?> ' }}<# } #></a> <div class="actions"> <a class="edit edit-form" data-view="form-pane" data-form-id="{{ form.id }}" href="#form-pane-{{ form.id }}"><?php esc_html_e('Edit', 'custom-contact-forms'); ?> </a> | <a class="insert-form-button"><?php esc_html_e('Insert into post', 'custom-contact-forms'); ?> </a> | <a class="duplicate"><?php esc_html_e('Duplicate form', 'custom-contact-forms'); ?> </a> | <a class="delete"><?php esc_html_e('Trash', 'custom-contact-forms'); ?> </a> </div> </td> <td> {{ utils.getPrettyPostDate( form.date_gmt ) }} </td> <td> {{ form.author.user_login }} </td> <td> {{ form.fields.length }} </td> <td> {{ form.submissions }} </td> </script> <script type="text/html" id="ccf-form-mce-preview"> <div class="ccf-form-preview form-id-{{ form.id }}"> <# if ( form.title.raw ) { #> <h2>{{ form.title.raw }}</h2> <# } #> <# if ( form.description && form.description != '' ) { #> <p>{{ form.description }}</p> <# } #> <# if ( form.fields ) { #> <# _.each( form.fields, function( field ) { #> <div class="field {{ field.type }} field-{{ field.id }}"> {{{ field.preview }}} </div> <# } ); #> <# } #> <div class="field-submit"> <input type="button" value="{{ form.buttonText }}"> </div> </div> </script> <script type="text/html" id="ccf-form-mce-error-preview"> <div class="ccf-form-preview preview-error"> <?php esc_html_e('There is a problem with this form. Is it trashed or deleted?', 'custom-contact-forms'); ?> </div> </script> <script type="text/html" id="ccf-submission-table-template"> <table class="widefat fixed" cellpadding="0" cellspacing="0"> <thead> <tr> <# _.each( columns, function( column ) { #> <th scope="col" class="manage-column column-{{ column }}"> <# if ( 'date' === column ) { #> <?php esc_html_e('Date', 'custom-contact-forms'); ?> <# } else { #> {{ column }} <# } #> </th> <# } ); #> <th scope="col" class="manage-column column-actions"></th> </tr> </thead> <tfoot> <tr> <# _.each( columns, function( column ) { #> <th scope="col" class="manage-column column-{{ column }}"> <# if ( 'date' === column ) { #> <?php esc_html_e('Date', 'custom-contact-forms'); ?> <# } else { #> {{ column }} <# } #> </th> <# } ); #> <th scope="col" class="manage-column column-actions"></th> </tr> </tfoot> <tbody class="submission-rows"> <tr> <td colspan="{{ columns.length + 1 }}"> <div class="spinner" style="background: url( '<?php echo esc_url(admin_url('images/wpspin_light.gif')); ?> ' ) no-repeat;"></div> </td> </tr> </tbody> </table> <div class="ccf-pagination"></div> </script> <script type="text/html" id="ccf-submission-row-template"> <# if ( ! submission.fields || '' == submission.fields ) { submission.fields = {}; } _.each( currentColumns, function( column ) { #> <# if ( 'date' === column ) { #> <td colspan="1">{{ utils.getPrettyPostDate( submission.date_gmt ) }}</td> <# } else { #> <td colspan="1"> <# if ( submission.data[column] ) { #> <# if ( submission.data[column] instanceof Object ) { var output = '', i = 0; #> <# if ( utils.isFieldDate( submission.data[column], submission.fields[column] ) ) { #> {{ utils.wordChop( utils.getPrettyFieldDate( submission.data[column], submission.fields[column] ), 30 ) }} <# } else if ( utils.isFieldName( submission.data[column], submission.fields[column] ) ) { #> {{ utils.wordChop( utils.getPrettyFieldName( submission.data[column], submission.fields[column] ), 30 ) }} <# } else if ( utils.isFieldAddress( submission.data[column], submission.fields[column] ) ) { #> {{ utils.wordChop( utils.getPrettyFieldAddress( submission.data[column], submission.fields[column] ), 30 ) }} <# } else if ( utils.isFieldEmailConfirm( submission.data[column], submission.fields[column] ) ) { #> {{ utils.wordChop( utils.getPrettyFieldEmailConfirm( submission.data[column], submission.fields[column] ), 30 ) }} <# } else if ( utils.isFieldFile( submission.data[column], submission.fields[column] ) ) { #> <a href="{{ submission.data[column].url }}">{{ submission.data[column].file_name }}</a> <# } else { #> <# for ( var key in submission.data[column] ) { if ( submission.data[column].hasOwnProperty( key ) ) { if ( submission.data[column][key] !== '' ) { if ( i > 0 ) { output += ', '; } output += submission.data[column][key]; i++; } } } #> <# if ( output ) { #> {{ utils.wordChop( output, 30 ) }} <# } else { #> <span>-</span> <# } #> <# } #> <# } else { #> {{ utils.wordChop( submission.data[column], 30 ) }} <# } #> <# } else { #> <span>-</span> <# } #> </td> <# } #> <# } ); #> <td class="actions"> <a href="#TB_inline?height=300&width=400&inlineId=submission-content" data-submission-date="{{ submission.date_gmt }}" data-submission-id="{{ submission.id }}" class="view" data-icon=""></a> <a class="delete" data-icon=""></a> <div class="submission-wrapper" id="ccf-submission-content-{{ submission.id }}"> <div class="ccf-submission-content"> <# for ( column in submission.data ) { #> <div class="field-slug"> {{ column }} </div> <div class="field-content"> <# if ( submission.data[column] ) { #> <# if ( submission.data[column] instanceof Object ) { var output = '', i = 0; #> <# if ( utils.isFieldDate( submission.data[column], submission.fields[column] ) ) { #> {{ utils.getPrettyFieldDate( submission.data[column], submission.fields[column] ) }} <# } else if ( utils.isFieldName( submission.data[column], submission.fields[column] ) ) { #> {{ utils.getPrettyFieldName( submission.data[column], submission.fields[column] ) }} <# } else if ( utils.isFieldAddress( submission.data[column], submission.fields[column] ) ) { #> {{ utils.getPrettyFieldAddress( submission.data[column], submission.fields[column] ) }} <# } else if ( utils.isFieldEmailConfirm( submission.data[column], submission.fields[column] ) ) { #> {{ utils.getPrettyFieldEmailConfirm( submission.data[column], submission.fields[column] ) }} <# } else if ( utils.isFieldFile( submission.data[column], submission.fields[column] ) ) { #> <a href="{{ submission.data[column].url }}">{{ submission.data[column].file_name }}</a> <# } else { #> <# for ( var key in submission.data[column] ) { if ( submission.data[column].hasOwnProperty( key ) ) { if ( submission.data[column][key] !== '' ) { if ( i > 0 ) { output += ', '; } output += submission.data[column][key]; i++; } } } #> <# if ( output ) { #> {{ output }} <# } else { #> - <# } #> <# } #> <# } else { #> {{ submission.data[column] }} <# } #> <# } else { #> <span>-</span> <# } #> </div> <# } #> <div class="field-slug"> <?php esc_html_e('IP Address', 'custom-contact-forms'); ?> </div> <div class="field-content"> {{ submission.ip_address }} </div> </div> </div> </td> </script> <script type="text/html" id="ccf-no-submissions-row-template"> <td colspan="{{ columns.length + 1 }}" class="no-submissions"><?php esc_html_e('There are no submissions.', 'custom-contact-forms'); ?> </td> </script> <script type="text/html" id="ccf-submissions-controller-template"> <# var i = 0; _.each( columns, function( column ) { #> <label for="ccf-column-{{ column }}"> <input class="submission-column-checkbox" type="checkbox" id="ccf-column-{{ column }}" <# if ( i < 4 || 'date' === column ) { #>checked<# } #> value="{{ column }}"> <# if ( 'date' === column ) { #> <?php esc_html_e('Date', 'custom-contact-forms'); ?> <# } else { #> {{ column }} <# } #> </label> <# i++; }); #> </script> <?php do_action('ccf_underscore_templates'); }
private function check_post_status($status) { if (is_null($status)) { return true; } $stati = get_post_statuses(); if (empty($stati) || is_wp_error($stati)) { WP_CLI::warning('Could not find any post stati'); return false; } if (!isset($stati[$status])) { WP_CLI::warning(sprintf('Could not find a post_status matching %s. Here is a list of available stati: %s', $status, implode(", ", array_keys($stati)))); return false; } $this->export_args['status'] = $status; return true; }
/** * Get the query params for collections of attachments. * * @return array */ public function get_collection_params() { $params = parent::get_collection_params(); $params['slug'] = array('description' => __('Limit result set to products with a specific slug.', 'woocommerce'), 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg'); $params['status'] = array('default' => 'any', 'description' => __('Limit result set to products assigned a specific status.', 'woocommerce'), 'type' => 'string', 'enum' => array_merge(array('any'), array_keys(get_post_statuses())), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg'); $params['type'] = array('description' => __('Limit result set to products assigned a specific type.', 'woocommerce'), 'type' => 'string', 'enum' => array_keys(wc_get_product_types()), 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg'); $params['sku'] = array('description' => __('Limit result set to products with a specific SKU.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['featured'] = array('description' => __('Limit result set to featured products.', 'woocommerce'), 'type' => 'boolean', 'sanitize_callback' => 'wc_string_to_bool', 'validate_callback' => 'rest_validate_request_arg'); $params['category'] = array('description' => __('Limit result set to products assigned a specific category ID.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg'); $params['tag'] = array('description' => __('Limit result set to products assigned a specific tag ID.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg'); $params['shipping_class'] = array('description' => __('Limit result set to products assigned a specific shipping class ID.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg'); $params['attribute'] = array('description' => __('Limit result set to products with a specific attribute.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['attribute_term'] = array('description' => __('Limit result set to products with a specific attribute term ID (required an assigned attribute).', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'wp_parse_id_list', 'validate_callback' => 'rest_validate_request_arg'); if (wc_tax_enabled()) { $params['tax_class'] = array('description' => __('Limit result set to products with a specific tax class.', 'woocommerce'), 'type' => 'string', 'enum' => array_map('sanitize_title', array_merge(array('standard'), WC_Tax::get_tax_classes())), 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); } $params['in_stock'] = array('description' => __('Limit result set to products in stock or out of stock.', 'woocommerce'), 'type' => 'boolean', 'sanitize_callback' => 'wc_string_to_bool', 'validate_callback' => 'rest_validate_request_arg'); $params['on_sale'] = array('description' => __('Limit result set to products on sale.', 'woocommerce'), 'type' => 'boolean', 'sanitize_callback' => 'wc_string_to_bool', 'validate_callback' => 'rest_validate_request_arg'); $params['min_price'] = array('description' => __('Limit result set to products based on a minimum price.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); $params['max_price'] = array('description' => __('Limit result set to products based on a maximum price.', 'woocommerce'), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg'); return $params; }
echo $options['meta_similarity']; ?> </span>%</strong> <div id="meta_similarity"></div> <input type="hidden" value="<?php echo $options['meta_similarity']; ?> " name="meta_similarity"> </li> <li id="statuses"><?php echo __('Include these <strong>statuses</strong>:', 'find-duplicates'); ?> <br/> <?php $statuses = get_post_statuses(); foreach ($statuses as $key => $value) { echo '<input name="meta_status[]" type="checkbox" value="' . $key . '"'; if (in_array($key, $options['meta_statuses'])) { echo ' checked'; } echo '> ' . $value . '<br />'; } ?> </li> <li id="dates"><?php echo __('Limit by <strong>post date</strong>:', 'find-duplicates'); ?> <br/> <?php echo __('from', 'find-duplicates');
/** * Imports data from CSV file using ajax. * * @since 1.0.0 * @package GeoDirectory * @global object $wpdb WordPress Database object. * @global string $plugin_prefix Geodirectory plugin table prefix. * @global object $current_user Current user object. */ function geodir_ajax_import_csv() { error_reporting(0); // hide error to get clean json response global $wpdb, $plugin_prefix, $current_user; $uploads = wp_upload_dir(); ini_set('auto_detect_line_endings', true); $wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses. $task = isset($_POST['task']) ? $_POST['task'] : ''; $uploadedFile = isset($_POST['gddata']['uploadedFile']) ? $_POST['gddata']['uploadedFile'] : NULL; $filename = $uploadedFile; $uploads = wp_upload_dir(); $uploads_dir = $uploads['path']; $image_name_arr = explode('/', $filename); $filename = end($image_name_arr); $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; $return = array(); $return['file'] = $uploadedFile; $return['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory'); if (is_file($target_path) && file_exists($target_path) && $uploadedFile) { $wp_filetype = wp_check_filetype_and_ext($target_path, $filename); if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') { $return['error'] = NULL; $return['rows'] = 0; if (($handle = fopen($target_path, "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { if (is_array($data) && !empty($data)) { $file[] = '"' . implode('","', $data) . '"'; } } fclose($handle); $file = $file; } $return['rows'] = !empty($file) && count($file) > 1 ? count($file) - 1 : 0; if (!$return['rows'] > 0) { $return['error'] = __('No data found in csv file.', 'geodirectory'); } } } if ($task == 'prepare' || !empty($return['error'])) { echo json_encode($return); exit; } $totRecords = isset($_POST['gddata']['totRecords']) ? $_POST['gddata']['totRecords'] : NULL; $importlimit = isset($_POST['gddata']['importlimit']) ? $_POST['gddata']['importlimit'] : 1; $count = $importlimit; $requested_limit = $importlimit; $tmpCnt = isset($_POST['gddata']['tmpcount']) ? $_POST['gddata']['tmpcount'] : 0; if ($count < $totRecords) { $count = $tmpCnt + $count; if ($count > $totRecords) { $count = $totRecords; } } else { $count = $totRecords; } $total_records = 0; $rowcount = 0; $address_invalid = 0; $blank_address = 0; $upload_files = 0; $invalid_post_type = 0; $invalid_title = 0; $customKeyarray = array(); $gd_post_info = array(); $post_location = array(); $countpost = 0; if (!empty($file)) { $columns = isset($file[0]) ? geodir_str_getcsv($file[0]) : NULL; $customKeyarray = $columns; if (empty($columns) || !empty($columns) && $columns[0] == '') { $return['error'] = CSV_INVAILD_FILE; echo json_encode($return); exit; } for ($i = 1; $i <= $importlimit; $i++) { $current_index = $tmpCnt + $i; if (isset($file[$current_index])) { $total_records++; $buffer = geodir_str_getcsv($file[$current_index]); $post_title = addslashes($buffer[0]); $current_post_author = $buffer[1]; $post_desc = addslashes($buffer[2]); $post_cat = array(); $catids_arr = array(); $post_cat = trim($buffer[3]); // comma seperated category name if ($post_cat) { $post_cat_arr = explode(',', $post_cat); for ($c = 0; $c < count($post_cat_arr); $c++) { $catid = wp_kses_normalize_entities(trim($post_cat_arr[$c])); if (!empty($buffer[5])) { if (in_array($buffer[5], geodir_get_posttypes())) { $p_taxonomy = geodir_get_taxonomies(addslashes($buffer[5])); if (get_term_by('name', $catid, $p_taxonomy[0])) { $cat = get_term_by('name', $catid, $p_taxonomy[0]); $catids_arr[] = $cat->slug; } else { if (get_term_by('slug', $catid, $p_taxonomy[0])) { $cat = get_term_by('slug', $catid, $p_taxonomy[0]); $catids_arr[] = $cat->slug; } else { $ret = wp_insert_term($catid, $p_taxonomy[0]); if ($ret && !is_wp_error($ret)) { if (get_term_by('name', $catid, $p_taxonomy[0])) { $cat = get_term_by('name', $catid, $p_taxonomy[0]); $catids_arr[] = $cat->slug; } elseif (get_term_by('slug', $catid, $p_taxonomy[0])) { $cat = get_term_by('slug', $catid, $p_taxonomy[0]); $catids_arr[] = $cat->slug; } } } } } } } } if (!$catids_arr) { $catids_arr[] = 1; } $post_tags = trim($buffer[4]); // comma seperated tags $tag_arr = ''; if ($post_tags) { $tag_arr = explode(',', $post_tags); } $table = $plugin_prefix . $buffer[5] . '_detail'; // check table in database $error = ''; if ($wpdb->get_var("SHOW TABLES LIKE '" . $table . "'") != $table) { $invalid_post_type++; continue; } if ($post_title != '') { $menu_order = 0; $image_folder_name = 'uplaod/'; $image_names = array(); for ($c = 5; $c < count($customKeyarray); $c++) { $gd_post_info[$customKeyarray[$c]] = addslashes($buffer[$c]); if ($customKeyarray[$c] == 'IMAGE') { $buffer[$c] = trim($buffer[$c]); if (!empty($buffer[$c])) { $image_names[] = $buffer[$c]; } } if ($customKeyarray[$c] == 'alive_days') { if ($buffer[$c] != '0' && $buffer[$c] != '') { $submitdata = date('Y-m-d'); $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata . "+" . addslashes($buffer[$c]) . " days")); } else { $gd_post_info['expire_date'] = 'Never'; } } if ($customKeyarray[$c] == 'post_city') { $post_city = addslashes($buffer[$c]); } if ($customKeyarray[$c] == 'post_region') { $post_region = addslashes($buffer[$c]); } if ($customKeyarray[$c] == 'post_country') { $post_country = addslashes($buffer[$c]); } if ($customKeyarray[$c] == 'post_latitude') { $post_latitude = addslashes($buffer[$c]); } if ($customKeyarray[$c] == 'post_longitude') { $post_longitude = addslashes($buffer[$c]); } // Post status if ($customKeyarray[$c] == 'post_status') { $post_status = sanitize_key($buffer[$c]); } } /* ================ before array create ============== */ $location_result = geodir_get_default_location(); if (!isset($gd_post_info['post_city']) || $gd_post_info['post_city'] == '' || (!isset($gd_post_info['post_region']) || $gd_post_info['post_region'] == '') || (!isset($gd_post_info['post_country']) || $gd_post_info['post_country'] == '') || (!isset($gd_post_info['post_address']) || $gd_post_info['post_address'] == '') || (!isset($gd_post_info['post_latitude']) || $gd_post_info['post_latitude'] == '') || (!isset($gd_post_info['post_longitude']) || $gd_post_info['post_longitude'] == '')) { $blank_address++; continue; } else { if ($location_result->location_id == 0) { if (geodir_strtolower($gd_post_info['post_city']) != geodir_strtolower($location_result->city) || geodir_strtolower($gd_post_info['post_region']) != geodir_strtolower($location_result->region) || geodir_strtolower($gd_post_info['post_country']) != geodir_strtolower($location_result->country)) { $address_invalid++; continue; } } } // Default post status $default_status = 'publish'; $post_status = !empty($post_status) ? sanitize_key($post_status) : $default_status; $post_status = !empty($wp_post_statuses) && !isset($wp_post_statuses[$post_status]) ? $default_status : $post_status; $my_post['post_title'] = $post_title; $my_post['post_content'] = $post_desc; $my_post['post_type'] = addslashes($buffer[5]); $my_post['post_author'] = $current_post_author; $my_post['post_status'] = $post_status; $my_post['post_category'] = $catids_arr; $my_post['post_tags'] = $tag_arr; $gd_post_info['post_tags'] = $tag_arr; $gd_post_info['post_title'] = $post_title; $gd_post_info['post_status'] = $post_status; $gd_post_info['submit_time'] = time(); $gd_post_info['submit_ip'] = $_SERVER['REMOTE_ADDR']; $last_postid = wp_insert_post($my_post); $countpost++; // Check if we need to save post location as new location if ($location_result->location_id > 0) { if (isset($post_city) && isset($post_region)) { $request_info['post_location'] = array('city' => $post_city, 'region' => $post_region, 'country' => $post_country, 'geo_lat' => $post_latitude, 'geo_lng' => $post_longitude); $post_location_info = $request_info['post_location']; if ($location_id = geodir_add_new_location($post_location_info)) { $post_location_id = $location_id; } } else { $post_location_id = 0; } } else { $post_location_id = 0; } /* ------- get default package info ----- */ $payment_info = array(); $package_info = array(); $package_info = (array) geodir_post_package_info($package_info, '', $buffer[5]); $package_id = ''; if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') { $package_id = $gd_post_info['package_id']; } if (!empty($package_info)) { $payment_info['package_id'] = $package_info['pid']; if (isset($package_info['alive_days']) && $package_info['alive_days'] != 0) { $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['alive_days'] . " days")); } else { $payment_info['expire_date'] = 'Never'; } $gd_post_info = array_merge($gd_post_info, $payment_info); } $gd_post_info['post_location_id'] = $post_location_id; $post_type = get_post_type($last_postid); $table = $plugin_prefix . $post_type . '_detail'; geodir_save_post_info($last_postid, $gd_post_info); if (!empty($image_names)) { $upload_files++; $menu_order = 1; foreach ($image_names as $image_name) { $img_name_arr = explode('.', $image_name); $uploads = wp_upload_dir(); $sub_dir = $uploads['subdir']; $arr_file_type = wp_check_filetype($image_name); $uploaded_file_type = $arr_file_type['type']; $attachment = array(); $attachment['post_id'] = $last_postid; $attachment['title'] = $img_name_arr[0]; $attachment['content'] = ''; $attachment['file'] = $sub_dir . '/' . $image_name; $attachment['mime_type'] = $uploaded_file_type; $attachment['menu_order'] = $menu_order; $attachment['is_featured'] = 0; $attachment_set = ''; foreach ($attachment as $key => $val) { if ($val != '') { $attachment_set .= $key . " = '" . $val . "', "; } } $attachment_set = trim($attachment_set, ", "); $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set); if ($menu_order == 1) { $post_type = get_post_type($last_postid); $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($sub_dir . '/' . $image_name, $last_postid))); } $menu_order++; } } $gd_post_info['package_id'] = $package_id; /** This action is documented in geodirectory-functions/post-functions.php */ do_action('geodir_after_save_listing', $last_postid, $gd_post_info); if (!empty($buffer[5])) { if (in_array($buffer[5], geodir_get_posttypes())) { $taxonomies = geodir_get_posttype_info(addslashes($buffer[5])); wp_set_object_terms($last_postid, $my_post['post_tags'], $taxonomy = $taxonomies['taxonomies'][1]); wp_set_object_terms($last_postid, $my_post['post_category'], $taxonomy = $taxonomies['taxonomies'][0]); $post_default_category = isset($my_post['post_default_category']) ? $my_post['post_default_category'] : ''; $post_category_str = isset($my_post['post_category_str']) ? $my_post['post_category_str'] : ''; geodir_set_postcat_structure($last_postid, $taxonomy, $post_default_category, $post_category_str); } } } else { $invalid_title++; } } } } $return['rowcount'] = $countpost; $return['invalidcount'] = $address_invalid; $return['blank_address'] = $blank_address; $return['upload_files'] = $upload_files; $return['invalid_post_type'] = $invalid_post_type; $return['invalid_title'] = $invalid_title; $return['total_records'] = $total_records; echo json_encode($return); exit; }
/** * Retrieve post statuses. * * @since 2.5.0 * * @param array $args Method parameters. * @return array|IXR_Error */ public function wp_getPostStatusList($args) { $this->escape($args); $username = $args[1]; $password = $args[2]; if (!($user = $this->login($username, $password))) { return $this->error; } if (!current_user_can('edit_posts')) { return new IXR_Error(403, __('You are not allowed access to details about this site.')); } /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ do_action('xmlrpc_call', 'wp.getPostStatusList'); return get_post_statuses(); }
<?php $has_license_key = Tribe__Events__Aggregator::is_service_active(); if ('edit' === $aggregator_action) { $default_post_status = get_post_meta($record->post->ID, Tribe__Events__Aggregator__Record__Abstract::$meta_key_prefix . 'post_status', true); $default_category = get_post_meta($record->post->ID, Tribe__Events__Aggregator__Record__Abstract::$meta_key_prefix . 'category', true); } $default_post_status = empty($default_post_status) ? tribe_get_option('tribe_aggregator_default_post_status', 'draft') : $default_post_status; $default_category = empty($default_category) ? tribe_get_option('tribe_aggregator_default_category', '') : $default_category; $post_statuses = get_post_statuses(array()); $category_dropdown = array(); $category_dropdown = wp_dropdown_categories(array('echo' => false, 'name' => 'aggregator[category]', 'id' => 'tribe-ea-field-category', 'hide_empty' => false, 'class' => 'tribe-ea-field tribe-ea-dropdown tribe-ea-size-large', 'orderby' => 'post_title', 'taxonomy' => Tribe__Events__Main::TAXONOMY)); $category_dropdown = preg_replace('!\\<select!', '<select data-hide-search', $category_dropdown); $category_dropdown = preg_replace('!(\\<select[^\\>]*\\>)!', '$1<option value="">' . __('No Additional Categories', 'the-events-calendar') . '</option>', $category_dropdown); $category_dropdown = preg_replace('!(value="' . $default_category . '")!', '$1 selected', $category_dropdown); wp_nonce_field('tribe-aggregator-save-import', 'tribe_aggregator_nonce'); ?> <input type="hidden" name="aggregator[action]" id="tribe-action" value="<?php echo esc_attr($aggregator_action); ?> "> <input type="hidden" name="aggregator[import_id]" id="tribe-import_id" value="<?php echo esc_attr(empty($record->meta['import_id']) ? '' : $record->meta['import_id']); ?> "> <table class="form-table"> <tbody> <?php $field = (object) array(); $field->source = 'origins';