function insert_attachment($file_handler, $post_id, $setthumb = 'false') { // check to make sure its a successful upload if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; $attach_id = media_handle_upload($file_handler, $post_id); if ($setthumb) { update_post_meta($post_id, '_thumbnail_id', $attach_id); } return $attach_id; }
/** * Core admin bar include. * * @since 6.2.0 */ function core_admin_bar() { $app = \Liten\Liten::getInstance(); $filename = APP_PATH . 'views/dashboard/core-admin-bar.php'; if (!is_readable($filename)) { __return_false(); } if (!$app->hook->has_filter('core_admin_bar')) { include $filename; } return $app->hook->apply_filter('core_admin_bar', $filename); }
/** * Register all admin scripts * * @since 2.1 */ public function register_all_scripts() { /** Get the extension */ $ext = apply_filters('easingsliderlite_debug_scripts', __return_false()) ? '.js' : '.min.js'; /** Register scripts */ wp_register_script('esl-admin', plugins_url(dirname(plugin_basename(self::get_file())) . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'admin' . $ext), array('jquery', 'jquery-ui-sortable', 'backbone'), self::$version, true); wp_register_script('esl-customizer', plugins_url(dirname(plugin_basename(self::get_file())) . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'customizer' . $ext), array('jquery', 'backbone'), self::$version); wp_register_script('esl-slideshow', plugins_url(dirname(plugin_basename(self::get_file())) . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slideshow' . $ext), false, self::$version); }
function kv_handle_attachment($file_handler, $post_id, $set_thu = false) { // check to make sure its a successful upload if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; $attach_id = media_handle_upload($file_handler, $post_id); // If you want to set a featured image frmo your uploads. if ($set_thu) { set_post_thumbnail($post_id, $attach_id); } return $attach_id; }
echo admin_url("admin.php?page=easingsliderlite_edit_slideshow"); ?> " style="position: absolute; top: -15px; left: -15px; z-index: 50;"> <img src="<?php echo plugins_url(dirname(plugin_basename(EasingSliderLite::get_file()))) . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'edit_icon.png'; ?> " style="box-shadow: none; border-radius: none;" /> </a> <?php } ?> </div> <?php /** Display the slideshow shadow */ if (!apply_filters('easingsliderlite_disable_shadow', __return_false())) { /** Get the inline styling */ $styles = $c->shadow->enable ? 'display: block; ' : 'display: none; '; $styles .= $s->dimensions->responsive ? "max-width: {$s->dimensions->width}px; " : "width: {$s->dimensions->width}px; "; $styles .= $c->border->width !== 0 ? "margin-left: {$c->border->width}px;" : ''; /** Print the shadow */ if (!has_action('easingsliderlite_shadow')) { echo "<div class='easingsliderlite-shadow' style='{$styles}'>"; if ($c->shadow->enable) { echo "<img src='{$c->shadow->image}' alt='' />"; } echo "</div>"; } else { do_action('easingsliderlite_shadow', $s, $c); } }
function sight($file_handler, $post_id, $set_thu = false) { // check to make sure its a successful upload if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; $attach_id = media_handle_upload($file_handler, $post_id); return $attach_id; }
public function insert_avatar_attachment($file_avt, $user_id, $avtar_type, $setthumb = 'false') { global $wpdb; // check to make sure its a successful upload if ($_FILES[$file_avt]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; $attach_id = media_handle_upload($file_avt, $user_id); $profile_image = $this->get_user_avatar($user_id, $avtar_type); if (!empty($profile_image[0]->meta_value)) { $del = $this->update_user_new_avtar($user_id, $profile_image[0]->meta_value, $avtar_type); if ($del) { update_user_meta($user_id, '_thumbnail_id_' . $avtar_type, $attach_id); } } else { $data_usermeta = array('user_id' => $user_id, 'meta_key' => '_thumbnail_id_' . $avtar_type, 'meta_value' => $attach_id); $wpdb->insert("{$wpdb->usermeta}", $data_usermeta); } return $attach_id; }
function insert_attachment($file_handler, $post_id, $meta_name) { if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; $attach_id = media_handle_upload($file_handler, $post_id); $attach_url = wp_get_attachment_url($attach_id); update_post_meta($post_id, $meta_name, $attach_url); }
function addthis_plugin_options_php4() { require_once 'addthis_settings_functions.php'; global $addthis_styles; global $addthis_languages; global $addthis_settings; global $addthis_menu_types; global $addthis_new_styles; global $addthis_default_options; global $addthis_addjs; global $current_user; $user_id = $current_user->ID; if (get_user_meta($user_id, 'addthis_nag_updated_options')) { delete_user_meta($user_id, 'addthis_nag_updated_options', 'true'); } ?> <div class="wrap"> <h2 class='placeholder'> </h2> <form id="addthis_settings" method="post" action="options.php"> <?php // use the old-school settings style in older versions of wordpress if (addthis_get_wp_version() >= 2.7 || apply_filters('at_assume_latest', __return_false()) || apply_filters('addthis_assume_latest', __return_false())) { settings_fields('addthis'); } else { wp_nonce_field('update-options'); } $addthis_options = get_option('addthis_settings'); if ($addthis_options == false) { add_option('addthis_settings', array()); } foreach (array('addthis_show_stats', 'addthis_append_data', 'addthis_showonhome', 'addthis_showonpages', 'addthis_showonarchives', 'addthis_showoncats') as $option) { if ($addthis_options && !isset($addthis_options[$option])) { $addthis_options[$option] = false; } } $options = wp_parse_args($addthis_options, $addthis_default_options); extract($options); ?> <p><?php echo $addthis_addjs->getAtPluginPromoText(); ?> </p> <img alt='addthis' src="//cache.addthis.com/icons/v1/thumbs/32x32/more.png" class="header-img"/> <span class="addthis-title">AddThis</span> <span class="addthis-plugin-name">Share</span> <div class="page-header" id="tabs"> <ul class="nav-tab-wrapper"> <li><h2 class="nav-tab-wrapper"><a href="#tabs-1">Basic</a></h2></li> <li><h2 class="nav-tab-wrapper"><a href="#tabs-2">Advanced</a></h2></li> <li style="float: right; border: none;padding-right:0px;"> <strong><?php _e("AddThis Profile ID:", 'addthis_trans_domain'); ?> </strong> <input id="addthis_profile" type="text" name="addthis_settings[addthis_profile]" value="<?php echo $profile; ?> " autofill='off' autocomplete='off' /> <br /> <span id="addthis-profile-validation-message" style="float: right;color:red;font-size:10px"></span> <?php if ($credential_validation_status == 1) { echo '<span style="float: right;color:green;font-size:10px;">✔ Valid AddThis Profile ID</span>'; } ?> </li> </ul> <div class='clear'> </div> <div id="tabs-1"> <div style="float: left;width: 620px; margin-right: 10px;"> <?php echo $version_notification_content = _addthis_version_notification($atversion_update_status, $atversion); ?> <input type="hidden" value="<?php echo $atversion; ?> " name="addthis_settings[atversion]" id="addthis_atversion_hidden" /> <input type="hidden" value="<?php echo $atversion_update_status; ?> " name="addthis_settings[atversion_update_status]" id="addthis_atversion_update_status" /> <input type="hidden" value="<?php echo $credential_validation_status; ?> " name="addthis_settings[credential_validation_status]" id="addthis_credential_validation_status" /> <table class="form-table"> <tbody> <?php _addthis_choose_icons('above', $options); ?> <?php _addthis_choose_icons('below', $options); ?> </tbody> </table> <br/> <div style="margin-left:5px;font-weight:bold"> <?php _e("<a href='https://www.addthis.com/register?profile=wpp' target='_blank'>Register</a> for free in-depth analytics reports and better understand your site's social traffic.", 'addthis_trans_domain'); ?> </div> <table class="form-table" style="width:600px;"> <tbody> <tr valign="top"> <td width="200"><?php _e("AddThis email / username:"******"addthis_username" type="text" name="addthis_settings[addthis_username]" value="<?php echo $username; ?> " autofill='off' autocomplete='off' /></td> </tr> <tr id="password_row" > <td><?php _e("AddThis password:"******"font-size:10px">(required for displaying stats)</span></td> <td><input id="addthis_password" type="password" name="addthis_settings[addthis_password]" value="<?php echo $password; ?> " autocomplete='off' autofill='off' /></td> </tr> <tr> <td style="height:32px"> </td> <td style="vertical-align:top;margin-top:0;padding-top:0;line-height:5px;font-size:10px"> <img class="addthis-admin-loader" style="display:none" src="<?php echo plugins_url('img/loader.gif', __FILE__); ?> " /> <span class="addthis-admin-loader" style="display:none;color:gray">Connecting to AddThis profile <?php echo $profile; ?> ..</span> <span id="addthis-credential-validation-message" style="color:red"></span> <?php if ($credential_validation_status == 1) { echo '<span style="color:green">✔ Valid AddThis Credentials</span>'; } ?> </td> </tr> </tbody> </table> <div class='clear'> </div> <br/> </div> <div style="display:block; float:left; width:470px;"> <div id="preview_floater"> <table class="form-table"> <tbody> <tr> <td id="below" colspan="2"> <fieldset> <legend id="previewHeader"> <strong>Preview</strong> </legend> <div id="previewBox" class="previewbox"> <div id="addthis_share_demo" class="addthis_tshare_demo" > <div class="addthis-share-list"> <h3 style="margin-top:0;">Another Post with Everything in it</h3> <div id="above_previewContainer" style="float: left; width: 100%;"></div> <p style="float: left; width: 100%;">Published by <a href="#">admin</a> on September 17, 2008 | <a href="#">2 Responses</a> | <a href="#">Edit</a></p> <div id="preview_post"><p style="float: left; width: 100%;">Lorem dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p></div> <div id="below_previewContainer" style="float: left; width: 100%;"></div> <p style="float:left;">Posted in <a href="#">Child Category I</a>, <a href="#">Parent Category I</a>, <a href="#">Parent Category II</a></p> </div> </div> </div> </fieldset> </td> </tr> </tbody> </table> </div> </div> </div> <div id="tabs-2"> <?php echo $version_notification_content; ?> <table class="form-table"> <tr> <th><h2>Show AddThis on …</h2></th> </tr> <th scope="row"><?php _e("homepage:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_showonhome]" value="true" <?php echo $addthis_showonhome == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("<a href=\"//codex.wordpress.org/Pages\" target=\"blank\">pages</a>:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_showonpages]" value="true" <?php echo $addthis_showonpages == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("archives:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_showonarchives]" value="true" <?php echo $addthis_showonarchives == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("categories:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_showoncats]" value="true" <?php echo $addthis_showoncats == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("excerpts:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_showonexcerpts]" value="true" <?php echo $addthis_showonexcerpts == true ? 'checked="checked"' : ''; ?> /></td> </tr> <?php if ($addthis_settings['placement'] != "0") { ?> <tr> <th scope="row"><?php _e("after title:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_aftertitle]" value="true" <?php echo $addthis_aftertitle == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("before comments:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_beforecomments]" value="true" <?php echo $addthis_beforecomments == true ? 'checked="checked"' : ''; ?> /></td> </tr> <?php } ?> <tr> <th><h2>Have AddThis track …</h2></th> </tr> <tr> <th scope="row"><?php _e("<a href=\"//www.addthis.com/blog/2010/03/11/clickback-analytics-measure-traffic-back-to-your-site-from-addthis/\" target=\"_blank\">clickbacks</a>:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_append_data]" value="true" <?php echo $addthis_append_data == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("address bar shares:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_addressbar]" value="true" <?php echo $addthis_addressbar == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("copied text:", 'addthis_trans_domain'); ?> </th> <?php if (isset($addthis_copytracking1) && $addthis_copytracking1 == true) { echo "<input type='hidden' name='addthis_settings[addthis_copytrackingremove' value='true'/>"; $addthis_copytracking2 = false; } ?> <!-- <td><input type="checkbox" name="addthis_settings[addthis_copytracking1]" value="true" <?php echo $addthis_copytracking1 == true ? 'checked="checked"' : ''; ?> /></td> --> <td><input type="checkbox" name="addthis_settings[addthis_copytracking2]" value="true" <?php echo $addthis_copytracking2 == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th><h2>Display Options</h2></th> </tr> <tr valign="top"> <td colspan="2">For more details on the following options, see <a href="//support.addthis.com/customer/portal/articles/381263-addthis-client-api">our customization documentation</a>.</td> </tr> <tr valign="top"> <th scope="row"><?php _e("Custom service list:", 'addthis_trans_domain'); ?> <br /><span class='description'><?php _e('Important: AddThis optimizes displayed services based on popularity and language, and personalizes the list for each user. You may decrease sharing by overriding these features.', 'addthis_trans_domain'); ?> </span></th> <td><input size='60' type="text" name="addthis_settings[addthis_options]" value="<?php echo $addthis_options; ?> " /><br /> <span class='description'><?php _e('Enter a comma-separated list of <a href="//addthis.com/services/list">service codes</a>', 'addthis_trans_domain'); ?> </span> </td> </tr> <tr valign="top" class="classicFeature"> <th scope="row"><?php _e("Brand:", 'addthis_trans_domain'); ?> </th> <td><input type="text" name="addthis_settings[addthis_brand]" value="<?php echo $addthis_brand; ?> " /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Twitter via:", 'addthis_trans_domain'); ?> </th> <td><input type="text" name="addthis_settings[addthis_twitter_template]" value="<?php echo get_first_twitter_username($addthis_twitter_template); ?> " /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Language:", 'addthis_trans_domain'); ?> </th> <td> <select name="addthis_settings[addthis_language]"> <?php $curlng = $addthis_language; foreach ($addthis_languages as $lng => $name) { echo "<option value=\"{$lng}\"" . ($lng == $curlng ? " selected='selected'" : "") . ">{$name}</option>"; } ?> </select> </td> </tr> <tr valign="top" class="classicFeature"> <th scope="row"><?php _e("Header background:", 'addthis_trans_domain'); ?> </th> <td><input type="text" name="addthis_settings[addthis_header_background]" value="<?php echo $addthis_header_background; ?> " /></td> </tr> <tr valign="top" class="classicFeature"> <th scope="row"><?php _e("Header color:", 'addthis_trans_domain'); ?> </th> <td><input type="text" name="addthis_settings[addthis_header_color]" value="<?php echo $addthis_header_color; ?> " /></td> </tr> <tr> <th><h2>Additional Options</h2></th> </tr> <tr> <th scope="row"><?php _e("Show analytics in admin dashboard:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_show_stats]" value="true" <?php echo $addthis_show_stats == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <tr> <th scope="row"><?php _e("Enable enhanced accessibility:", 'addthis_trans_domain'); ?> </th> <td><input type="checkbox" name="addthis_settings[addthis_508]" value="true" <?php echo $addthis_508 == true ? 'checked="checked"' : ''; ?> /></td> </tr> <tr> <th scope="row"><?php _e("Google Analytics property ID:", 'addthis_trans_domain'); ?> </th> <td><input type="text" name="addthis_settings[data_ga_property]" value="<?php echo $data_ga_property; ?> "/></td> </tr> <tr valign="top"> <td colspan="2"></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Bitly login:"******"text" name="addthis_settings[addthis_bitly_login]" value="<?php echo $addthis_bitly_login; ?> " /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("Bitly key:", 'addthis_trans_domain'); ?> </th> <td><input type="text" name="addthis_settings[addthis_bitly_key]" value="<?php echo $addthis_bitly_key; ?> " /></td> </tr> <tr valign="top"> <th scope="row"><?php _e("addthis_config values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain'); ?> </th> <td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_config_json]" id="addthis-config-json"/><?php echo $addthis_config_json; ?> </textarea></td> <td id="config-error" style="display: none;color: red;float: left;margin-top: 25px;width: 150px;">Invalid JSON format</td> </tr> <tr valign="top"> <th scope="row"><?php _e("addthis_share values:<br/><span class=\"description\">(json format)</span>", 'addthis_trans_domain'); ?> </th> <td><textarea rows='3' cols='40' type="text" name="addthis_settings[addthis_share_json]" id="addthis-share-json" /><?php echo $addthis_share_json; ?> </textarea></td> <td id="share-error" style="display: none;color: red;float: left;margin-top: 25px;width: 150px;">Invalid JSON format</td> </tr> </table> <div class='clear'> </div> </div> </div> <div class="clear"> </div> <p class="submit"> <?php // Build Preview Link $preview_link = esc_url(get_option('home') . '/'); if (is_ssl()) { $preview_link = str_replace('http://', 'https://', $preview_link); } $stylesheet = get_option('stylesheet'); $template = get_option('template'); $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true'), $preview_link)); ?> <input type="submit" name="Submit" value="<?php _e('Save Changes'); ?> " id="submit-button"/> <a href="<?php echo $preview_link; ?> " class="thickbox thickbox-preview" id="preview" ><?php _e('Preview'); ?> </a> </p> </form> </div> <?php }
do_action('admin_print_styles'); ?> <?php wp_print_scripts('jquery'); ?> <script type="text/javascript" src="<?php echo get_option('siteurl'); ?> /wp-includes/js/tinymce/tiny_mce_popup.js"></script> </head> <body style="min-width:90%!important;width:90%;height:90%"> <?php if (!empty($_POST['bpci-img-send']) && $_FILES["bpci_upload_image"]["name"] && preg_match('!^image/!', $_FILES["bpci_upload_image"]["type"]) && $_FILES["bpci_upload_image"]["size"] <= $max_upload_image) { // check to make sure its a successful upload if ($_FILES['bpci_upload_image']['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; $attach_id = media_handle_upload('bpci_upload_image', 0); $upload_dir = wp_upload_dir(); $img_data = wp_get_attachment_metadata($attach_id); $img_dir_array = explode('/', $img_data["file"]); $img_dir = $upload_dir['baseurl'] . '/' . $img_dir_array[0] . '/' . $img_dir_array[1]; //if too small if (!$img_data["sizes"]["thumbnail"]["file"]) { $img_preview = $upload_dir['baseurl'] . '/' . $img_data["file"]; } else { $img_preview = $img_dir . '/' . $img_data["sizes"]["thumbnail"]["file"]; }
function save_form_submissions() { $status = $cu_email = ''; //process $_POST array foreach ($_POST as $ff => $post) { if (!is_array($post)) { $_POST[$ff] = urldecode($post); } } // edit or add new if (isset($_POST['form_action']) && isset($_POST['eventid']) && $_POST['form_action'] == 'editform') { $created_event_id = (int) $_POST['eventid']; $this->formtype = 'edit'; $__post_content = !empty($_POST['event_description']) ? wpautop(convert_chars(stripslashes($_POST['event_description']))) : null; // update event name and event details $event = array('ID' => $created_event_id, 'post_title' => wp_strip_all_tags($_POST['event_name']), 'post_content' => $__post_content); wp_update_post($event); } else { $created_event_id = $this->create_post(); $this->formtype = 'new'; } if ($created_event_id) { // saved field valy $saved_fields = !empty($this->evoau_opt['evoau_fields']) && is_array($this->evoau_opt['evoau_fields']) && count($this->evoau_opt['evoau_fields']) > 0 ? $this->evoau_opt['evoau_fields'] : false; // SAVE DATE TIMES and start/end - meta data if (isset($_POST['event_start_date'])) { // if no end date $end_date = !empty($_POST['event_end_date']) ? $_POST['event_end_date'] : $_POST['event_start_date']; // start times $start_time = !empty($_POST['event_start_time']) ? $_POST['event_start_time'] : '1:00:am'; $end_time = !empty($_POST['event_end_time']) ? $_POST['event_end_time'] : '11:55:pm'; $start_time = explode(":", $start_time); $end_time = explode(":", $end_time); $__ampm_s = !empty($start_time[2]) ? $start_time[2] : null; $__ampm_e = !empty($end_time[2]) ? $end_time[2] : null; // date and time array $date_array_end = array('evcal_end_date' => $end_date, 'evcal_end_time_hour' => $end_time[0], 'evcal_end_time_min' => $end_time[1], 'evcal_et_ampm' => $__ampm_e, 'evcal_start_date' => $_POST['event_start_date'], 'evcal_start_time_hour' => $start_time[0], 'evcal_start_time_min' => $start_time[1], 'evcal_st_ampm' => $__ampm_s); // all day events if (!empty($_POST['event_all_day']) && $_POST['event_all_day'] == 'yes') { $this->create_custom_fields($created_event_id, 'evcal_allday', 'yes'); } if (!empty($_POST['evo_hide_endtime']) && $_POST['evo_hide_endtime'] == 'yes') { $this->create_custom_fields($created_event_id, 'evo_hide_endtime', 'yes'); } // merge both start and end time values $date_array = $date_array_end; $__evo_date_format = !empty($_POST['_evo_date_format']) ? $_POST['_evo_date_format'] : 'd/m/Y'; $_evo_time_format = !empty($_POST['_evo_time_format']) ? $_POST['_evo_time_format'] : '12h'; $proper_time = eventon_get_unix_time($date_array, $__evo_date_format, $_evo_time_format); // save required start time variables $this->create_custom_fields($created_event_id, 'evcal_srow', $proper_time['unix_start']); $this->create_custom_fields($created_event_id, 'evcal_erow', $proper_time['unix_end']); } // create custom meta fields and assign taxonomies foreach ($this->au_form_fields('savefields') as $field => $fn) { $__var_name = $fn[1]; // check if value passed if (isset($_POST[$__var_name])) { // for event taxonomies if ($fn[2] == 'tax') { // save post terms if (count($_POST[$__var_name]) > 0 && is_array($_POST[$__var_name])) { // for tax #1 and #2 if ($field == 'event_type_2' || $field == 'event_type') { $ab = $field == 'event_type' ? '' : '_2'; $terms = $_POST[$__var_name]; // append default tax terms if activated in options if (!empty($this->evoau_opt['evoau_set_def_ett' . $ab]) && !empty($this->evoau_opt['evoau_def_ett_v' . $ab]) && $this->evoau_opt['evoau_def_ett_v' . $ab] != '-' && $this->evoau_opt['evoau_set_def_ett' . $ab] == 'yes') { $terms[] = $this->evoau_opt['evoau_def_ett_v' . $ab]; } wp_set_post_terms($created_event_id, $terms, $field); } else { wp_set_post_terms($created_event_id, $_POST[$__var_name], $field); } } } else { $value = addslashes($_POST[$__var_name]); $this->create_custom_fields($created_event_id, $__var_name, $value); } // custom meta field that is a button if ($fn[2] == 'button' && !empty($_POST[$__var_name . 'L'])) { $this->create_custom_fields($created_event_id, $__var_name . 'L', $_POST[$__var_name . 'L']); } } // end if var not set // create new tax term if ($fn[2] == 'tax' && !empty($_POST[$__var_name . '_new'])) { $terms = $_POST[$__var_name . '_new']; $terms = explode(',', $terms); foreach ($terms as $term) { $this->set_new_term($term, $__var_name, $created_event_id); } } // Assign tax terms if activated but NOT visible on the form if ($field == 'event_type_2' || $field == 'event_type') { $ab = $field == 'event_type' ? '' : '_2'; // append default tax terms if activated in options if (!empty($this->evoau_opt['evoau_set_def_ett' . $ab]) && !empty($this->evoau_opt['evoau_def_ett_v' . $ab]) && $this->evoau_opt['evoau_def_ett_v' . $ab] != '-' && $this->evoau_opt['evoau_set_def_ett' . $ab] == 'yes') { $terms[] = $this->evoau_opt['evoau_def_ett_v' . $ab]; wp_set_post_terms($created_event_id, $terms, $field); } } // image if ($field == 'event_image') { // on edit form if image already set if (isset($_POST['event_image_exists']) && $_POST['event_image_exists'] == 'yes') { continue; } if (!empty($_FILES) && 'POST' == $_SERVER['REQUEST_METHOD']) { if ($_FILES[$__var_name]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . '/wp-admin/includes/media.php'; require_once ABSPATH . '/wp-admin/includes/file.php'; require_once ABSPATH . '/wp-admin/includes/image.php'; $attachmentId = media_handle_upload($__var_name, $created_event_id); unset($_FILES); set_post_thumbnail($created_event_id, $attachmentId); $this->create_custom_fields($created_event_id, 'ftimg', $attachmentId); } } } // end foreach // event color $COLOR = !empty($_POST['evcal_event_color']) ? $_POST['evcal_event_color'] : (!empty($this->options['evcal_hexcode']) ? $this->options['evcal_hexcode'] : '206177'); $this->create_custom_fields($created_event_id, 'evcal_event_color', $COLOR); if (isset($_POST['evcal_event_color_n'])) { $this->create_custom_fields($created_event_id, 'evcal_event_color_n', $_POST['evcal_event_color_n']); } // current user $current_user = wp_get_current_user(); // if user is logged in if (!empty($current_user)) { // get the user email if the user is logged in and has email $cu_email = $current_user->user_email; } // assign author is set to do so if ($this->formtype == 'new' && is_user_logged_in() && !empty($this->evoau_opt['evoau_assignu']) && $this->evoau_opt['evoau_assignu'] == 'yes') { // if user is logged in if (!empty($current_user)) { $user_id = (string) $current_user->ID; wp_set_object_terms($created_event_id, array($user_id), 'event_users'); } } // Save user interaction fields if ($saved_fields && in_array('user_interaction', $saved_fields) || !empty($this->evoau_opt['evoau_ux']) && $this->evoau_opt['evoau_ux'] == 'yes') { if (isset($_POST['uinter'])) { // only for external links if ($_POST['uinter'] == 2) { if (!empty($_POST['_evcal_exlink_target'])) { $this->create_custom_fields($created_event_id, '_evcal_exlink_target', $_POST['_evcal_exlink_target']); } if (!empty($_POST['evcal_exlink'])) { $this->create_custom_fields($created_event_id, 'evcal_exlink', $_POST['evcal_exlink']); } } } $ux_val = !empty($_POST['uinter']) ? $_POST['uinter'] : (!empty($this->evoau_opt['evoau_ux']) && $this->evoau_opt['evoau_ux'] == 'yes' ? $this->evoau_opt['evoau_ux_val'] : false); if ($ux_val) { $this->create_custom_fields($created_event_id, '_evcal_exlink_option', $ux_val); } } //$this->create_custom_fields($created_event_id,'aaa', $debug); // generate google maps if (!empty($_POST['evcal_location'])) { $this->create_custom_fields($created_event_id, 'evcal_gmap_gen', 'yes'); } else { $this->create_custom_fields($created_event_id, 'evcal_gmap_gen', 'no'); } // location cordinates if (!empty($_POST['event_location_cord']) && strpos($_POST['event_location_cord'], ',') !== false) { $cord = explode(',', $_POST['event_location_cord']); $this->create_custom_fields($created_event_id, 'evcal_lat', $cord[0]); $this->create_custom_fields($created_event_id, 'evcal_lon', $cord[1]); } // save location as taxonomy if (!empty($_POST['evcal_location_name'])) { $this->set_new_term($_POST['evcal_location_name'], 'event_location', $created_event_id); $this->create_custom_fields($created_event_id, 'evcal_location_name_select', $_POST['evcal_location_name']); } // save organizer as taxonomy if (!empty($_POST['evcal_organizer'])) { $this->set_new_term($_POST['evcal_organizer'], 'event_organizer', $created_event_id); $this->create_custom_fields($created_event_id, 'evcal_organizer_name_select', $_POST['evcal_organizer']); $this->create_custom_fields($created_event_id, 'evo_evcrd_field_org', 'no'); } // SET RSVP for event if (!empty($this->evoau_opt['evoar_rsvp_addon']) && $this->evoau_opt['evoar_rsvp_addon'] == 'yes') { $this->create_custom_fields($created_event_id, 'evors_rsvp', 'yes'); } // save submitter email address if (!empty($_POST['yourname']) && isset($_POST['yourname'])) { $this->create_custom_fields($created_event_id, '_submitter_name', $_POST['yourname']); } // save email address for submitter if (!empty($_POST['youremail']) && isset($_POST['youremail'])) { $this->create_custom_fields($created_event_id, '_submitter_email', $_POST['youremail']); } elseif (!empty($cu_email)) { // save current user email if it exist $this->create_custom_fields($created_event_id, '_submitter_email', $cu_email); } // save whether to notify when draft is published if submission saved as draft if (empty($this->evoau_opt['evoau_post_status']) || !empty($this->evoau_opt['evoau_post_status']) && $this->evoau_opt['evoau_post_status'] == 'draft') { $this->create_custom_fields($created_event_id, '_send_publish_email', 'true'); } // email notification $__evo_admin_email = get_option('admin_email'); if ($this->formtype == 'new') { $this->send_au_email_notif($created_event_id, $__evo_admin_email); $this->send_submitter_email_notif($created_event_id, $__evo_admin_email); } return array('status' => 'good', 'msg' => ''); } else { // could not create custom post type return array('status' => 'bad', 'msg' => 'nof4'); } }
/** * Prints the tweets * * @since 1.0 */ public function show() { /** Get the tweets */ $tweets = $this->get(); /** Bail if there are no tweets */ if (!$tweets) { if (current_user_can('edit_plugins')) { echo '<p style="color: red;">' . __('No tweets found. Please make sure your settings are correct.', 'displaytweets') . '</p>'; } return; } echo '<div class="as_display_tweet_wrapper">'; /** Print the tweets */ foreach ($tweets as $tweet) { if (has_action('displaytweets_tweet_template')) { /** Execute action that should print the tweet template */ do_action('displaytweets_tweet_template', $tweet); } else { /** Set the date and time format */ $datetime_format = apply_filters('displaytweets_datetime_format', "l M j \\- g:ia"); /** Get the date and time posted as a nice string */ $posted_since = apply_filters('displaytweets_posted_since', date_i18n($datetime_format, strtotime($tweet->created_at))); /** Filter for linking dates to the tweet itself */ $link_date = apply_filters('displaytweets_link_date_to_tweet', __return_false()); if ($link_date) { $posted_since = "<a href=\"https://twitter.com/{$tweet->user->screen_name}/status/{$tweet->id_str}\">{$posted_since}</a>"; } /** Print tweet */ echo "<div class='as_display_tweet'><span class='dslc-icon dslc-icon-twitter'></span><p>{$this->format_tweet($tweet->text)}<br /><small class=\"muted\">- {$posted_since}</small></p><div class='clearfix'></div></div>"; } } echo '</div>'; }
/** * Alias of __return_false */ function shoestrap_return_false() { _shoestrap_deprecated_function(__FUNCTION__, '3.2', '__return_false()'); return __return_false(); }
/** * Initialises The Options Via The Settings API * * @since 0.1 */ public function settings_init() { /** * Add The Settings Sections */ add_settings_section('tb_general_options', __('Post Type / Taxonomy Archive Titles', 'totally-booked'), __return_false(), 'tb_general'); add_settings_section('tb_rewrite_options', __('Rewrite Options', 'totally-booked'), array($this, 'rewrite_intro_text'), 'tb_advanced'); add_settings_section('tb_cssjs_options', __('CSS And Javascript Options', 'totally-booked'), __return_false(), 'tb_advanced'); add_settings_section('tb_archive_options', __('Archive Display Options', 'totally-booked'), __return_false(), 'tb_advanced'); add_settings_section('tb_popup_options', __('Popup Display Options', 'totally-booked'), __return_false(), 'tb_advanced'); add_settings_section('tb_theme_compat_options', __('Theme Compatibility Options', 'totally-booked'), array($this, 'theme_compat_intro_text'), 'tb_theme_compat'); /** * Register The Settings */ register_setting('tb_general_options', 'author_archive_title'); register_setting('tb_general_options', 'genre_archive_title'); register_setting('tb_general_options', 'series_archive_title'); register_setting('tb_general_options', 'book_archive_title'); register_setting('tb_advanced', 'book_archive_slug'); register_setting('tb_advanced', 'book_author_slug'); register_setting('tb_advanced', 'book_genre_slug'); register_setting('tb_advanced', 'book_series_slug'); register_setting('tb_advanced', 'tb_output_js'); register_setting('tb_advanced', 'tb_output_css'); register_setting('tb_advanced', 'tb_archive_posts_per_page'); register_setting('tb_advanced', 'tb_hide_local_bookstore'); register_setting('tb_theme_compat', 'tb_wrapper_start'); register_setting('tb_theme_compat', 'tb_wrapper_end'); /** * General Options */ $args = array('name' => 'author_archive_title', 'description' => __('Enter the title for the author archive, Leave this blank to default to the authors name', 'totally-booked')); add_settings_field('author_archive_title', __('Author Archive Title', 'totally-booked'), array($this, 'option_textfield'), 'tb_general', 'tb_general_options', $args); $args = array('name' => 'genre_archive_title', 'description' => __('Enter the title for the genre archive, Leave this blank to default to the genre name', 'totally-booked')); add_settings_field('genre_archive_title', __('Genre Archive Title', 'totally-booked'), array($this, 'option_textfield'), 'tb_general', 'tb_general_options', $args); $args = array('name' => 'series_archive_title', 'description' => __('Enter the title for the series archive, Leave this blank to default series name', 'totally-booked')); add_settings_field('series_archive_title', __('Series Archive Title', 'totally-booked'), array($this, 'option_textfield'), 'tb_general', 'tb_general_options', $args); $args = array('name' => 'book_archive_title', 'description' => __('Enter the title for the book archive, Leave this blank to default to "Book Archives"', 'totally-booked')); add_settings_field('book_archive_title', __('Books Archive Title', 'totally-booked'), array($this, 'option_textfield'), 'tb_general', 'tb_general_options', $args); /** * Rewrite Options */ $args = array('name' => 'book_archive_slug', 'description' => __('Slug for the books archive page', 'totally-booked')); add_settings_field('book_archive_slug', __('Books Archive Slug', 'totally-booked'), array($this, 'option_textfield'), 'tb_advanced', 'tb_rewrite_options', $args); $args = array('name' => 'book_author_slug', 'description' => __('Slug for the author archives', 'totally-booked')); add_settings_field('book_author_slug', __('Author Archive Slug', 'totally-booked'), array($this, 'option_textfield'), 'tb_advanced', 'tb_rewrite_options', $args); $args = array('name' => 'book_genre_slug', 'description' => __('Slug for the genre archive', 'totally-booked')); add_settings_field('book_genre_slug', __('Genre Archive Slug', 'totally-booked'), array($this, 'option_textfield'), 'tb_advanced', 'tb_rewrite_options', $args); $args = array('name' => 'book_series_slug', 'description' => __('Slug for the series archives', 'totally-booked')); add_settings_field('book_series_slug', __('Series Archive Slug', 'totally-booked'), array($this, 'option_textfield'), 'tb_advanced', 'tb_rewrite_options', $args); /** * CSS / JS Options */ $args = array('name' => 'tb_output_js', 'description' => __('Uncheck this option to disable javascript output (Not recommended unless you know what you are doing)', 'totally-booked')); add_settings_field('tb_output_js', __('Output Javascript', 'totally-booked'), array($this, 'option_checkbox'), 'tb_advanced', 'tb_cssjs_options', $args); $args = array('name' => 'tb_output_css', 'description' => __('Uncheck this option to disable CSS output (Not recommended unless you know what you are doing)', 'totally-booked')); add_settings_field('tb_output_css', __('Output CSS', 'totally-booked'), array($this, 'option_checkbox'), 'tb_advanced', 'tb_cssjs_options', $args); /** * Archive Settings */ $args = array('name' => 'tb_archive_posts_per_page', 'description' => __('Please enter the maximum number of posts to display per page on the Totally Booked archive pages. Leave this blank to revert to the WordPress default.', 'totally-booked')); add_settings_field('tb_archive_posts_per_page', __('Archive Maximum Posts', 'totally-booked'), array($this, 'option_textfield'), 'tb_advanced', 'tb_archive_options', $args); /** * Popup Display Settings */ $args = array('name' => 'tb_hide_local_bookstore', 'description' => __('Check this to remove the local bookstore finder from the Buy Now popup.', 'totally-booked')); add_settings_field('tb_hide_local_bookstore', __('Hide the local bookstore finder in the popup?', 'totally-booked'), array($this, 'option_checkbox'), 'tb_advanced', 'tb_popup_options', $args); /** * Theme Compat Options */ $args = array('name' => 'tb_wrapper_start', 'description' => __('Enter the HTML snippet to output before the start of the Totally Booked content.', 'totally-booked')); add_settings_field('tb_wrapper_start', __('Wrapper Start HTML', 'totally-booked'), array($this, 'option_textarea'), 'tb_theme_compat', 'tb_theme_compat_options', $args); $args = array('name' => 'tb_wrapper_end', 'description' => __('Enter the HTML snippet to output after the Totally Booked content.', 'totally-booked')); add_settings_field('tb_wrapper_end', __('Wrapper End HTML', 'totally-booked'), array($this, 'option_textarea'), 'tb_theme_compat', 'tb_theme_compat_options', $args); }
/** * Add attachment to media library * * @param int $postId * @param string $fileHandler * * @return void * * @since 1.0 * @author Lorenzo giuffrida */ public function insert_attachment($fileHandler, $postId) { if ($_FILES[$fileHandler]['error'] !== UPLOAD_ERR_OK) { __return_false(); } require_once ABSPATH . "wp-admin" . '/includes/image.php'; require_once ABSPATH . "wp-admin" . '/includes/file.php'; require_once ABSPATH . "wp-admin" . '/includes/media.php'; return media_handle_upload($fileHandler, $postId); }
</label> </div> <p class="description"><?php _e('Select a position for the pagination icons.', 'easingsliderlite'); ?> </p> </div> <?php do_action('easingsliderlite_pagination_metabox', $s); ?> </div> </div> <!-- Playback --> <div class="widgets-holder-wrap closed" <?php if (apply_filters('easingsliderlite_hide_playback_metabox', __return_false())) { echo 'style="display: none;"'; } ?> > <div class="sidebar-name"> <div class="sidebar-name-arrow"></div> <h3><?php _e('Automatic Playback', 'easingsliderlite'); ?> </h3> </div> <div class="sidebar-content widgets-sortables" style="display: none;"> <div> <div class="radio clearfix"> <span><?php
/** * App and site settings data, including i18n strings for the client-side * * @since 4.2 */ public function site_settings() { $supported_formats = get_theme_support('post-formats'); $post_formats = array(); if (!empty($supported_formats[0]) && is_array($supported_formats[0])) { $post_formats[0] = __('Standard'); foreach ($supported_formats[0] as $post_format) { $post_formats[$post_format] = esc_html(get_post_format_string($post_format)); } } return array('version' => $this->plugin_version(), 'runtime_url' => $this->strip_url_scheme($this->runtime_url()), 'ajax_url' => $this->strip_url_scheme(admin_url('admin-ajax.php')), 'post_formats' => $post_formats, 'redir_in_parent' => apply_filters('press_this_redirect_in_parent', __return_false())); }
public function assumeLatest() { if (apply_filters('at_assume_latest', __return_false()) || apply_filters('addthis_assume_latest', __return_false())) { return true; } return false; }
/** * Set plugin defaults at run time. * * @since 1.0.0 */ public function set_defaults() { $this->include_protected_meta = apply_filters('rae_include_protected_meta', __return_false()); }
/** * Alias of __return_false */ function stachestack_return_false() { _stachestack_deprecated_function(__FUNCTION__, '3.2', '__return_false()'); return __return_false(); }