• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ud_get_wp_property函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ud_get_wp_property函数的典型用法代码示例。如果您正苦于以下问题:PHP ud_get_wp_property函数的具体用法?PHP ud_get_wp_property怎么用?PHP ud_get_wp_property使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ud_get_wp_property函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Run Upgrade Process
  *
  * @param $old_version
  * @param $new_version
  */
 public static function run($old_version, $new_version)
 {
     self::do_backup($old_version, $new_version);
     /**
      * WP-Property 1.42.4 and less compatibility
      */
     update_option("wpp_version", $new_version);
     /**
      * Specific upgrade conditions.
      */
     switch (true) {
         case version_compare($old_version, '2.1.1', '<'):
             /*
              * Enable Legacy Features
              */
             $settings = get_option('wpp_settings');
             if (!empty($settings['configuration'])) {
                 $settings['configuration']['enable_legacy_features'] = 'true';
             }
             update_option('wpp_settings', $settings);
             break;
     }
     /* Additional stuff can be handled here */
     do_action(ud_get_wp_property()->slug . '::upgrade', $old_version, $new_version);
 }
开发者ID:Juni4567,项目名称:mycashflow,代码行数:31,代码来源:class-upgrade.php


示例2: meta

 /**
  * Get meta value
  *
  * @param int $post_id
  * @param bool $saved
  * @param array $field
  *
  * @return mixed
  */
 static function meta($post_id, $saved, $field)
 {
     /**
      * For special fields like 'divider', 'heading' which don't have ID, just return empty string
      * to prevent notice error when displayin fields
      */
     if (empty($field['id'])) {
         return '';
     }
     /**
      * Maybe set value from parent
      */
     $post = get_post($post_id);
     if ($post && $post->post_parent > 0) {
         $property_inheritance = ud_get_wp_property('property_inheritance', array());
         $type = get_post_meta($post_id, 'property_type', true);
         if (isset($property_inheritance[$type]) && in_array($field['id'], $property_inheritance[$type])) {
             $meta = get_post_meta($post->post_parent, $field['id'], !$field['multiple']);
         }
     }
     if (!$meta) {
         $meta = get_post_meta($post_id, $field['id'], !$field['multiple']);
     }
     // Use $field['std'] only when the meta box hasn't been saved (i.e. the first time we run)
     $meta = !$saved && '' === $meta || array() === $meta ? $field['std'] : $meta;
     // Escape attributes
     $meta = call_user_func(array(RW_Meta_Box::get_class_name($field), 'esc_meta'), $meta);
     return $meta;
 }
开发者ID:Juni4567,项目名称:mycashflow,代码行数:38,代码来源:class-wpp-inherited.php


示例3: form

    /**
     * Renders form based on Shortcode's params
     *
     * @param array $instance
     */
    public function form($instance)
    {
        ?>
      <p>
        <label class="widefat" for="<?php 
        echo $this->get_field_id('_widget_title');
        ?>
"><?php 
        _e('Title', ud_get_wp_property('domain'));
        ?>
</label>
        <input class="widefat" id="<?php 
        echo $this->get_field_id('_widget_title');
        ?>
"
               name="<?php 
        echo $this->get_field_name('_widget_title');
        ?>
" type="text"
               value="<?php 
        echo !empty($instance['_widget_title']) ? $instance['_widget_title'] : '';
        ?>
"/>
        <span class="description"><?php 
        _e('Widget\'s Title', ud_get_wp_property('domain'));
        ?>
</span>
      </p>
      <?php 
        parent::form($instance);
    }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:36,代码来源:property-attributes.php


示例4: process_bulk_action

 /**
  * Handle Bulk Action's request
  *
  */
 public function process_bulk_action()
 {
     global $wpdb;
     try {
         switch ($this->current_action()) {
             case 'unassign':
                 if (empty($_REQUEST['post_ids']) || !is_array($_REQUEST['post_ids'])) {
                     throw new \Exception(sprintf(__('Invalid request: no %s IDs provided.', ud_get_wp_property('domain')), \WPP_F::property_label()));
                 }
                 $post_ids = $_REQUEST['post_ids'];
                 foreach ($post_ids as $post_id) {
                     $post_id = (int) $post_id;
                     if (!$post_id) {
                         throw new \Exception(sprintf(__('Invalid request: incorrect %s IDs provided.', ud_get_wp_property('domain')), \WPP_F::property_label()));
                     }
                     $wpdb->query($wpdb->prepare("\n                  UPDATE {$wpdb->posts}\n                  SET post_parent = '0'\n                  WHERE ID = %d\n                ", $post_id));
                     clean_post_cache($post_id);
                 }
                 $label = count($post_ids) > 1 ? __('Children', ud_get_wp_property('domain')) : __('Child', ud_get_wp_property('domain'));
                 $this->message = sprintf(__('Selected %s have been successfully un-assigned from current %s.', ud_get_wp_property('domain')), $label, \WPP_F::property_label());
                 break;
             default:
                 //** Any custom action can be processed using action hook */
                 do_action('wpp::children_list_table::process_bulk_action', $this->current_action());
                 break;
         }
     } catch (\Exception $e) {
         $this->error = $e->getMessage();
     }
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:34,代码来源:class-children-list-table.php


示例5: run

 /**
  * Run Upgrade Process
  *
  * @param $old_version
  * @param $new_version
  */
 public static function run($old_version, $new_version)
 {
     self::do_backup($old_version, $new_version);
     /**
      * WP-Property 1.42.4 and less compatibility
      */
     update_option("wpp_version", $new_version);
     /**
      * Specific upgrade conditions.
      */
     switch (true) {
         case version_compare($old_version, '2.1.1', '<'):
             /*
              * Enable Legacy Features
              */
             $settings = get_option('wpp_settings');
             if (!empty($settings['configuration'])) {
                 $settings['configuration']['enable_legacy_features'] = 'true';
             }
             update_option('wpp_settings', $settings);
         case version_compare($old_version, '2.1.3', '<'):
             /*
              * Set default pagination type 'slider'
              * to prevent issues on already existing sites.
              */
             $settings = get_option('wpp_settings');
             $settings['configuration']['property_overview']['pagination_type'] = 'slider';
             update_option('wpp_settings', $settings);
     }
     /* Additional stuff can be handled here */
     do_action(ud_get_wp_property()->slug . '::upgrade', $old_version, $new_version);
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:38,代码来源:class-upgrade.php


示例6: meta

 /**
  * Get meta value
  *
  * @param int $post_id
  * @param bool $saved
  * @param array $field
  *
  * @return mixed
  */
 static function meta($post_id, $saved, $field)
 {
     $meta = array('value' => false, 'options' => array());
     if (empty($field['id']) || ud_get_wp_property('configuration.address_attribute') !== $field['id']) {
         return array();
     }
     /**
      * Maybe set value from parent
      */
     $post = get_post($post_id);
     if ($post && $post->post_parent > 0) {
         $property_inheritance = ud_get_wp_property('property_inheritance', array());
         $type = get_post_meta($post_id, 'property_type', true);
         if (!isset($property_inheritance[$type]) || !in_array($field['id'], $property_inheritance[$type])) {
             return array();
         }
         $meta['value'] = get_post_meta($post->post_parent, $field['id'], true);
         $attributes = array_keys(ud_get_wp_property('property_stats', array()));
         foreach (self::$map as $k) {
             // Ignore meta if property attribute with the same name exists
             if (in_array($k, $attributes)) {
                 continue;
             }
             $meta['options'][$k] = get_post_meta($post->post_parent, $k, true);
         }
     }
     return $meta;
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:37,代码来源:class-wpp-inherited-address.php


示例7: __construct

 /**
  * init
  */
 public function __construct()
 {
     $taxonomies = array();
     $_taxonomies = ud_get_wp_property('taxonomies', array());
     if (!empty($_taxonomies) && is_array($_taxonomies)) {
         foreach ($_taxonomies as $k => $v) {
             $taxonomies[$k] = !empty($v['label']) ? $v['label'] : $k;
         }
     }
     $options = array('id' => 'property_terms', 'params' => array('property_id' => array('name' => sprintf(__('%s ID', ud_get_wp_property('domain')), \WPP_F::property_label()), 'description' => sprintf(__('If not empty, result will show particular %s, which ID is set.', ud_get_wp_property('domain')), \WPP_F::property_label()), 'type' => 'text', 'default' => ''), 'taxonomy' => array('name' => __('Taxonomy', ud_get_wp_property()->domain), 'description' => sprintf(__('Renders %s terms of particular taxonomy', ud_get_wp_property('domain')), \WPP_F::property_label()), 'type' => 'select', 'options' => $taxonomies)), 'description' => sprintf(__('Renders %s Terms for specific taxonomy', ud_get_wp_property()->domain), \WPP_F::property_label()), 'group' => 'WP-Property');
     parent::__construct($options);
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:15,代码来源:property-terms.php


示例8: __construct

 /**
  * Init
  */
 public function __construct()
 {
     $attributes = ud_get_wp_property('property_stats', array());
     /*
             $hidden_attributes = ud_get_wp_property( 'hidden_frontend_attributes', array() );
             foreach( $attributes as $k => $v ) {
               if( in_array( $k, $hidden_attributes ) ) {
                 unset( $attributes[$k] );
               }
             }
             //*/
     $options = array('id' => 'property_attributes', 'params' => array('sort_by_groups' => array('name' => __('Sort by groups', ud_get_wp_property()->domain), 'description' => __('Sort attributes by groups or not', ud_get_wp_property()->domain), 'type' => 'select', 'options' => array('true' => __('Yes', ud_get_wp_property()->domain), 'false' => __('No', ud_get_wp_property()->domain))), 'display' => array('name' => __('Display', ud_get_wp_property()->domain), 'description' => __('The way of displaying attributes', ud_get_wp_property()->domain), 'type' => 'select', 'options' => array('list' => __('Simple List', ud_get_wp_property()->domain), 'dl_list' => __('Definitions List', ud_get_wp_property()->domain), 'plain_list' => __('Plain List', ud_get_wp_property()->domain), 'detail' => __('Detailed List', ud_get_wp_property()->domain))), 'show_true_as_image' => array('name' => __('Show "True" as image', ud_get_wp_property()->domain), 'description' => __('Display boolean attributes like checkbox image.', ud_get_wp_property()->domain), 'type' => 'select', 'options' => array('false' => __('No', ud_get_wp_property()->domain), 'true' => __('Yes', ud_get_wp_property()->domain))), 'make_link' => array('name' => __('Make link', ud_get_wp_property()->domain), 'description' => __('Make URLs into clickable links', ud_get_wp_property()->domain), 'type' => 'select', 'options' => array('true' => __('Yes', ud_get_wp_property()->domain), 'false' => __('No', ud_get_wp_property()->domain))), 'hide_false' => array('name' => __('Hide false', ud_get_wp_property()->domain), 'description' => __('Hide attributes with false value', ud_get_wp_property()->domain), 'type' => 'select', 'options' => array('false' => __('No', ud_get_wp_property()->domain), 'true' => __('Yes', ud_get_wp_property()->domain))), 'return_blank' => array('name' => __('Return Blank', ud_get_wp_property()->domain), 'description' => __('Omit blank values or not.', ud_get_wp_property()->domain), 'type' => 'select', 'options' => array('false' => __('No', ud_get_wp_property()->domain), 'true' => __('Yes', ud_get_wp_property()->domain))), 'include' => array('name' => __('Include', ud_get_wp_property()->domain), 'description' => __('The list of attributes to be included. If no attribute checked, all available attributes will be shown.', ud_get_wp_property()->domain), 'type' => 'multi_checkbox', 'options' => $attributes), 'exclude' => array('name' => __('Exclude', ud_get_wp_property()->domain), 'description' => __('The list of attributes which will not be shown.', ud_get_wp_property()->domain), 'type' => 'multi_checkbox', 'options' => $attributes)), 'description' => sprintf(__('Renders %s Attributes List', ud_get_wp_property()->domain), \WPP_F::property_label()), 'group' => 'WP-Property');
     parent::__construct($options);
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:17,代码来源:property-attributes.php


示例9: get_template

 /**
  * Determines template and renders it
  *
  *
  */
 public function get_template($template, $data, $output = true)
 {
     $name = apply_filters($this->id . '_template_name', array($template), $this);
     /* Set possible pathes where templates could be stored. */
     $path = apply_filters($this->id . '_template_path', array(ud_get_wp_property()->path('static/views', 'dir')));
     $path = \UsabilityDynamics\Utility::get_template_part($name, $path, array('load' => false));
     if ($output) {
         extract($data);
         include $path;
     } else {
         ob_start();
         extract($data);
         include $path;
         return ob_get_clean();
     }
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:21,代码来源:class-shortcode.php


示例10: call

 /**
  * @param string $atts
  * @return string|void
  */
 public function call($atts = "")
 {
     $atts = shortcode_atts(array('property_id' => '', 'include' => ''), $atts);
     $meta = array();
     if (!empty($atts['include'])) {
         $include = explode(',', $atts['include']);
         foreach ($include as $k) {
             $k = trim($k);
             $v = ud_get_wp_property("property_meta.{$k}");
             if (!empty($v)) {
                 $meta[$k] = $v;
             }
         }
     } else {
         $meta = ud_get_wp_property('property_meta');
     }
     if (!empty($atts['property_id']) && is_numeric($atts['property_id'])) {
         $post_id = $atts['property_id'];
     } else {
         global $post;
         $post_id = $post->ID;
     }
     return $this->get_template('property-meta', array('meta' => $meta, 'post_id' => $post_id), false);
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:28,代码来源:property-meta.php


示例11: sprintf

        }
        ?>
       </ul>

        </div><?php 
        // .wpp_right_column
        ?>

    </div><?php 
        // .property_div
        ?>

    <?php 
    }
    /** end of the propertyloop. */
    ?>
    </div><?php 
    // .all-properties
    ?>
	</div><?php 
    // .wpp_row_view
} else {
    ?>
<div class="wpp_nothing_found">
   <p><?php 
    echo sprintf(__('Sorry, no properties found - try expanding your search, or <a href="%s">view all</a>.', ud_get_wp_property()->domain), site_url() . '/' . $wp_properties['configuration']['base_slug']);
    ?>
</p>
</div>
<?php 
}
开发者ID:ksan5835,项目名称:rankproperties,代码行数:31,代码来源:property-overview.php


示例12: do_action

        ?>
              </label>
            </li>
          <?php 
    }
    ?>
          <?php 
    do_action('wpp::types::inherited_attributes', $property_slug);
    ?>
        </ul>
      </td>

    </tr>

  <?php 
}
?>
  </tbody>

  <tfoot>
  <tr>
    <td colspan='5'>
      <input type="button" class="wpp_add_row button-secondary" value="<?php 
_e('Add Row', ud_get_wp_property()->domain);
?>
"/>
    </td>
  </tr>
  </tfoot>

</table>
开发者ID:ksan5835,项目名称:rankproperties,代码行数:31,代码来源:settings-developer-types.php


示例13: process_bulk_action

 /**
  * Handle Bulk Action's request
  *
  */
 public function process_bulk_action()
 {
     try {
         switch ($this->current_action()) {
             case 'untrash':
                 if (empty($_REQUEST['post_ids']) || !is_array($_REQUEST['post_ids'])) {
                     throw new \Exception(sprintf(__('Invalid request: no %s IDs provided.', ud_get_wp_property('domain')), \WPP_F::property_label()));
                 }
                 $post_ids = $_REQUEST['post_ids'];
                 foreach ($post_ids as $post_id) {
                     $post_id = (int) $post_id;
                     wp_untrash_post($post_id);
                 }
                 $this->message = sprintf(__('Selected %s have been successfully restored from Trash.', ud_get_wp_property('domain')), \WPP_F::property_label('plural'));
                 break;
             case 'delete':
                 if (empty($_REQUEST['post_ids']) || !is_array($_REQUEST['post_ids'])) {
                     throw new \Exception(sprintf(__('Invalid request: no %s IDs provided.', ud_get_wp_property('domain')), \WPP_F::property_label()));
                 }
                 $post_ids = $_REQUEST['post_ids'];
                 $trashed = 0;
                 $deleted = 0;
                 foreach ($post_ids as $post_id) {
                     $post_id = (int) $post_id;
                     if (get_post_status($post_id) == 'trash') {
                         $deleted++;
                         wp_delete_post($post_id);
                     } else {
                         $trashed++;
                         wp_trash_post($post_id);
                     }
                 }
                 if ($trashed > 0 && $deleted > 0) {
                     $this->message = sprintf(__('Selected %s have been successfully moved to Trash or deleted.', ud_get_wp_property('domain')), \WPP_F::property_label('plural'));
                 } elseif ($trashed > 0) {
                     $this->message = sprintf(__('Selected %s have been successfully moved to Trash.', ud_get_wp_property('domain')), \WPP_F::property_label('plural'));
                 } elseif ($deleted > 0) {
                     $this->message = sprintf(__('Selected %s have been successfully deleted.', ud_get_wp_property('domain')), \WPP_F::property_label('plural'));
                 } else {
                     throw new \Exception(sprintf(__('No one %s was deleted.', ud_get_wp_property('domain')), \WPP_F::property_label()));
                 }
                 break;
             default:
                 //** Any custom action can be processed using action hook */
                 do_action('wpp::all_properties::process_bulk_action', $this->current_action());
                 break;
         }
     } catch (\Exception $e) {
         $this->error = $e->getMessage();
     }
 }
开发者ID:Juni4567,项目名称:mycashflow,代码行数:55,代码来源:class-list-table.php


示例14: maybe_export_properties_to_scv

 /**
  * Exports all properties to CSV file
  */
 public function maybe_export_properties_to_scv()
 {
     if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'wpp_export_to_scv' && !empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'export_properties_to_scv')) {
         // output headers so that the file is downloaded rather than displayed
         header('Content-Type: text/csv; charset=utf-8');
         header('Content-Disposition: attachment; filename=properties.csv');
         $headings = array('ID' => __('ID', ud_get_wp_property('domain')), 'post_title' => __('Title', ud_get_wp_property('domain')), 'post_content' => __('Content', ud_get_wp_property('domain')), 'post_date' => __('Date', ud_get_wp_property('domain')), 'post_modified' => __('Modified Date', ud_get_wp_property('domain')), 'post_parent' => __('Falls Under', ud_get_wp_property('domain')), 'menu_order' => __('Menu Order', ud_get_wp_property('domain')), 'post_author' => __('Author', ud_get_wp_property('domain')), 'property_type_label' => __('Property Type', ud_get_wp_property('domain')));
         $headings = array_merge($headings, (array) ud_get_wp_property('property_stats', array()));
         $headings = array_merge($headings, (array) ud_get_wp_property('property_meta', array()));
         foreach ((array) ud_get_wp_property('geo_type_attributes', array()) as $k) {
             $headings[$k] = \WPP_F::de_slug($k);
         }
         $headings['latitude'] = __('Latitude', ud_get_wp_property('domain'));
         $headings['longitude'] = __('Longitude', ud_get_wp_property('domain'));
         $headings['permalink'] = __('Permalink', ud_get_wp_property('domain'));
         // create a file pointer connected to the output stream
         $output = fopen('php://output', 'w');
         // output the column headings
         fputcsv($output, array_values($headings));
         $ids = \WPP_F::get_properties();
         $keys = array_keys($headings);
         foreach ($ids as $id) {
             $property = Property_Factory::get($id, array('get_children' => 'false', 'load_gallery' => 'false', 'load_thumbnail' => 'true', 'load_parent' => 'false'));
             $data = array();
             foreach ($keys as $k) {
                 $v = isset($property[$k]) ? $property[$k] : '';
                 if (is_array($v)) {
                     $v = implode(',', $v);
                 }
                 switch ($k) {
                     case 'post_content':
                         $v = strip_shortcodes($v);
                         $v = apply_filters('the_content', $v);
                         $v = str_replace(']]>', ']]&gt;', $v);
                         $v = wp_trim_words($v, 55, '...');
                         break;
                     case 'author':
                         $v = get_the_author_meta('display_name', $v);
                         break;
                 }
                 $data[$k] = $v;
             }
             fputcsv($output, $data);
         }
         exit;
     }
 }
开发者ID:Juni4567,项目名称:mycashflow,代码行数:50,代码来源:class-export.php


示例15: add_meta_boxes

 /**
  * Add Meta Boxes to All Properties page.
  */
 public function add_meta_boxes()
 {
     $screen = get_current_screen();
     add_meta_box('posts_list', __('Overview', ud_get_wp_property('domain')), array($this, 'render_list_table'), $screen->id, 'normal');
     add_meta_box('posts_filter', sprintf(__('%s Search', ud_get_wp_property('domain')), \WPP_F::property_label('plural')), array($this, 'render_filter'), $screen->id, 'side');
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:9,代码来源:class-admin-overview.php


示例16: wpp_contextual_help

 /**
  * WPP Contextual Help
  *
  * @global $current_screen
  *
  * @param $args
  *
  * @author korotkov@ud
  */
 function wpp_contextual_help($args = array())
 {
     global $contextual_help;
     $defaults = array('contextual_help' => array());
     extract(wp_parse_args($args, $defaults));
     //** If method exists add_help_tab in WP_Screen */
     if (is_callable(array('WP_Screen', 'add_help_tab'))) {
         //** Loop through help items and build tabs */
         foreach ((array) $contextual_help as $help_tab_title => $help) {
             //** Add tab with current info */
             get_current_screen()->add_help_tab(array('id' => sanitize_title($help_tab_title), 'title' => __($help_tab_title, ud_get_wp_property()->domain), 'content' => implode("\n", (array) $contextual_help[$help_tab_title])));
         }
         //** Add help sidebar with More Links */
         get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:', ud_get_wp_property()->domain) . '</strong></p>' . '<p>' . __('<a href="https://usabilitydynamics.com/products/wp-property/" target="_blank">WP-Property Product Page</a>', ud_get_wp_property()->domain) . '</p>' . '<p>' . __('<a href="https://usabilitydynamics.com/products/wp-property/forum/" target="_blank">WP-Property Forums</a>', ud_get_wp_property()->domain) . '</p>' . '<p>' . __('<a href="https://usabilitydynamics.com/help/" target="_blank">WP-Property Tutorials</a>', ud_get_wp_property()->domain) . '</p>');
     } else {
         global $current_screen;
         add_contextual_help($current_screen->id, '<p>' . __('Please upgrade Wordpress to the latest version for detailed help.', ud_get_wp_property()->domain) . '</p><p>' . __('Or visit <a href="https://usabilitydynamics.com/tutorials/wp-property-help/" target="_blank">WP-Property Help Page</a> on UsabilityDynamics.com', ud_get_wp_property()->domain) . '</p>');
     }
 }
开发者ID:ksan5835,项目名称:rankproperties,代码行数:28,代码来源:class_core.php


示例17: __construct

 /**
  * Constructor
  * Sets default data.
  *
  *
  * @todo For the love of god, only apply the defaults on installation. - potanin@UD
  * @param bool $args
  */
 public function __construct($args = false)
 {
     global $wp_properties;
     //** STEP 1. Default */
     parent::__construct($args);
     //** STEP 2. */
     $data = array();
     //** This slug will be used to display properties on the front-end.  Most likely overwriten by get_option('wpp_settings'); */
     $data['configuration'] = array('autoload_css' => 'true', 'automatically_insert_overview' => 'true', 'base_slug' => 'property', 'currency_symbol' => '$', 'address_attribute' => 'location', 'google_maps_localization' => 'en', 'display_address_format' => '[city], [state]');
     //** Default setings for [property_overview] shortcode */
     $data['configuration']['property_overview'] = array('thumbnail_size' => 'tiny_thumb', 'fancybox_preview' => 'true', 'display_slideshow' => 'false', 'show_children' => 'true');
     $data['configuration']['single_property_view'] = array('map_image_type' => 'tiny_thumb', 'gm_zoom_level' => '13');
     //** Default setings for admin UI */
     $data['configuration']['admin_ui'] = array('overview_table_thumbnail_size' => 'tiny_thumb');
     $data['default_coords']['latitude'] = '57.7973333';
     $data['default_coords']['longitude'] = '12.0502107';
     //** Geo type attributes are predefined and should not be editable on property adding/updating */
     // @notice All these fields are automatically added as post_meta on revalidation.
     $data['geo_type_attributes'] = array('formatted_address', 'street_number', 'route', 'district', 'city', 'county', 'state', 'state_code', 'country', 'country_code', 'postal_code');
     //** Image URLs. */
     $data['images']['map_icon_shadow'] = WPP_URL . "images/map_icon_shadow.png";
     $data['configuration']['google_maps']['infobox_settings'] = array('show_direction_link' => true, 'show_property_title' => true);
     //** Default attribute label descriptions for the back-end */
     $data['descriptions'] = array('descriptions' => array('property_type' => sprintf(__('The %s type will determine the layout.', ud_get_wp_property()->domain), \WPP_F::property_label()), 'custom_attribute_overview' => __('Customize what appears in search results in the attribute section.  For example: 1bed, 2baths, area varies slightly.', ud_get_wp_property()->domain), 'tagline' => __('Will appear on overview pages and on top of every listing page.', ud_get_wp_property()->domain)));
     $_stored_settings = $this->get();
     //** Merge with default data. */
     $this->set(\UsabilityDynamics\Utility::extend($data, $this->get()));
     // Check if settings have or have been upated. (we determine if configuration is good)
     // @todo Add a better _version_ check.
     if (isset($_stored_settings['_updated']) && isset($_stored_settings['version']) && $_stored_settings['version'] === '2.0.0') {
         return $wp_properties = $this->get();
     }
     // Continue on to load/enforce defaults.
     //** STEP 3. */
     //** Setup default property types to be used. */
     $d = $this->get('property_types', false);
     // Should only be set on install, not added on every request. These literally can not be removed from settings... -potanin@UD
     // It is adding these defaults only if types are empty (install) - korotkov@UD
     if (empty($d) || !is_array($d)) {
         $this->set('property_types', array('building' => __('Building', ud_get_wp_property()->domain), 'floorplan' => __('Floorplan', ud_get_wp_property()->domain), 'single_family_home' => __('Single Family Home', ud_get_wp_property()->domain)));
     }
     //** Setup property types to be used. */
     $d = !$this->get('property_inheritance', false);
     if (!$d || !is_array($d)) {
         $this->set('property_inheritance', array('floorplan' => array('street_number', 'route', 'state', 'postal_code', 'location', 'display_address', 'address_is_formatted')));
     }
     //** Property stats. Can be searchable, displayed as input boxes on editing page. */
     $d = $this->get('property_stats', false);
     if (!$d || !is_array($d)) {
         $this->set('property_stats', array('location' => __('Address', ud_get_wp_property()->domain), 'price' => __('Price', ud_get_wp_property()->domain), 'deposit' => __('Deposit', ud_get_wp_property()->domain), 'area' => __('Area', ud_get_wp_property()->domain), 'phone_number' => __('Phone Number', ud_get_wp_property()->domain)));
     }
     //** Property meta.  Typically not searchable, displayed as textarea on editing page. */
     $d = $this->get('property_meta', false);
     if (!$d || !is_array($d)) {
         $this->set('property_meta', array('lease_terms' => __('Lease Terms', ud_get_wp_property()->domain), 'pet_policy' => __('Pet Policy', ud_get_wp_property()->domain), 'school' => __('School', ud_get_wp_property()->domain), 'tagline' => __('Tagline', ud_get_wp_property()->domain)));
     }
     //** On property editing page - determines which fields to hide for a particular property type */
     $d = $this->get('hidden_attributes', false);
     if (!is_array($d)) {
         $this->set('hidden_attributes', array('floorplan' => array('location', 'parking', 'school'), 'building' => array('price', 'bedrooms', 'bathrooms', 'area', 'deposit'), 'single_family_home' => array('deposit', 'lease_terms', 'pet_policy')));
     }
     //** Determines property types that have addresses. */
     $d = $this->get('location_matters', false);
     if (!is_array($d)) {
         $this->set('location_matters', array('building', 'single_family_home'));
     }
     //** Determine which property types should actually be searchable. */
     $d = $this->get('searchable_property_types', false);
     if (!is_array($d)) {
         $this->set('searchable_property_types', array('floorplan', 'single_family_home'));
     }
     //** Attributes to use in searching. */
     $d = $this->get('searchable_attributes', false);
     if (!is_array($d)) {
         $this->set('searchable_attributes', array('area', 'deposit', 'bedrooms', 'bathrooms', 'city', 'price'));
     }
     //** Convert phrases to searchable values.  Converts string stats into numeric values for searching and filtering. */
     $d = $this->get('search_conversions', false);
     if (!is_array($d)) {
         $this->set('search_conversions', array('bedrooms' => array(__('Studio', ud_get_wp_property()->domain) => '0.5')));
     }
     //** Don't load defaults if settings exist in db */
     $d = $this->get('image_sizes', false);
     if (!is_array($d)) {
         $this->set('image_sizes', array('map_thumb' => array('width' => '75', 'height' => '75'), 'tiny_thumb' => array('width' => '100', 'height' => '100'), 'sidebar_wide' => array('width' => '195', 'height' => '130'), 'slideshow' => array('width' => '640', 'height' => '235')));
     }
     $d = $this->get('configuration.google_maps.infobox_attributes', false);
     if (!is_array($d)) {
         $this->set('configuration.google_maps.infobox_attributes', array('bedrooms', 'bathrooms', 'price'));
     }
     //** STEP 4. */
     $wp_properties = $this->get();
//.........这里部分代码省略.........
开发者ID:Juni4567,项目名称:mycashflow,代码行数:101,代码来源:class-settings.php


示例18: _e

            _e('Edit', ud_get_wp_property()->domain);
            ?>
</a>
              </li>
              <li>
                <a class="<?php 
            wpp_css('property_overview::button', 'button');
            ?>
" href="<?php 
            echo WPP_F::base_url(FEPS_VIEW_PAGE, array('feps' => $property['ID'], 'hash' => $property['wpp::feps::pending_hash'], 'action' => 'remove'));
            ?>
" onclick="return confirm('<?php 
            _e('Are you sure?', ud_get_wp_property()->domain);
            ?>
')"><?php 
            _e('Remove', ud_get_wp_property()->domain);
            ?>
</a>
              </li>
            </ul>
          </li>
          <?php 
        }
        ?>
        </ul>
      </div>
    </div>
  <?php 
    }
    ?>
开发者ID:ksan5835,项目名称:rankproperties,代码行数:30,代码来源:property-overview-my-feps.php


示例19: wpp_show_coords

/**
 * Display latitude and longitude on listing edit page below address field
 *
 * Echos html content to be displayed after location attribute on property edit page
 *
 * @since 1.0
 * @uses WPP_F::get_coordinates() Creates an array from string $args.
 *
 * @param string $listing_id Listing ID must be passed
 */
function wpp_show_coords($listing_id = false)
{
    if (!$listing_id) {
        return;
    }
    // If latitude and logitude meta isn't set, returns false
    $coords = WPP_F::get_coordinates($listing_id);
    echo "<span class='description'>";
    if ($coords) {
        _e("Address was validated by Google Maps.", ud_get_wp_property()->domain);
    } else {
        _e("Address has not yet been validated, should be formatted as: street, city, state, postal code, country. Locations are validated through Google Maps.", ud_get_wp_property()->domain);
    }
    echo "</span>";
}
开发者ID:ksan5835,项目名称:rankproperties,代码行数:25,代码来源:default_api.php


示例20: extend_wpp_settings

        /**
         * Extend WP-Property settings:
         * - Extend Property Search with Taxonomies
         * - Adds Taxonomies to groups
         *
         */
        public function extend_wpp_settings()
        {
            global $wp_properties;
            /** STEP 1. Add taxonomies to searchable attributes */
            $taxonomies = $this->get('config.taxonomies', array());
            if (!isset($wp_properties['searchable_attributes']) || !is_array($wp_properties['searchable_attributes'])) {
                $wp_properties['searchable_attributes'] = array();
            }
            foreach ($taxonomies as $taxonomy => $data) {
                if (isset($data['public']) && $data['public']) {
                    array_push($wp_properties['searchable_attributes'], $taxonomy);
                }
            }
            ud_get_wp_property()->set('searchable_attributes', $wp_properties['searchable_attributes']);
            /** STEP 2. Add taxonomies to property stats groups */
            $groups = $this->get('config.groups', array());
            if (!isset($wp_properties['property_stats_groups']) || !is_array($wp_properties['property_stats_groups'])) {
                $wp_properties['property_stats_groups'] = array();
            }
            $wp_properties['property_stats_groups'] = array_merge($wp_properties['property_stats_groups'], $groups);
            ud_get_wp_property()->set('property_stats_groups', $wp_properties['property_stats_groups']);
            /** STEP 3. Extend Property Search form */
            add_filter('wpp::show_search_field_with_no_values', function ($bool, $slug) {
                $taxonomies = ud_get_wpp_terms('config.taxonomies', array());
                if (array_key_exists($slug, $taxonomies)) {
                    return true;
                }
                return $bool;
            }, 10, 2);
            /** Take care about Taxonomies fields */
            foreach ($taxonomies as $taxonomy => $data) {
                add_filter('wpp_search_form_field_' . $taxonomy, function ($html, $taxonomy, $label, $value, $input, $random_id) {
                    $search_input = ud_get_wp_property("searchable_attr_fields.{$taxonomy}");
                    $terms = get_terms($taxonomy, array('fields' => 'id=>name'));
                    ob_start();
                    switch ($search_input) {
                        case 'multi_checkbox':
                            ?>
                <ul class="wpp_multi_checkbox taxonomy <?php 
                            echo $taxonomy;
                            ?>
">
                  <?php 
                            foreach ($terms as $term_id => $label) {
                                ?>
                    <?php 
                                $unique_id = rand(10000, 99999);
                                ?>
                    <li>
                      <input name="wpp_search[<?php 
                                echo $taxonomy;
                                ?>
][]" <?php 
                                echo is_array($value) && in_array($term_id, $value) ? 'checked="true"' : '';
               

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP udecode函数代码示例发布时间:2022-05-23
下一篇:
PHP ucwords函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap