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

PHP get_post_modified_time函数代码示例

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

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



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

示例1: column_default

 /**
  * Renders the columns.
  *
  * @since 1.0.0
  * @param array $form 
  * @param string $column_name
  * @return string
  */
 public function column_default($form, $column_name)
 {
     switch ($column_name) {
         case 'id':
             $value = $form->ID;
             break;
         case 'shortcode':
             $value = '[wpforms id="' . $form->ID . '"]';
             break;
         case 'created':
             $value = get_the_date(get_option('date_format'), $form);
             break;
         case 'modified':
             $value = get_post_modified_time(get_option('date_format'), false, $form);
             break;
         case 'author':
             $author = get_userdata($form->post_author);
             $value = $author->display_name;
             break;
         case 'php':
             $value = '<code style="display:block;font-size:11px;">if( function_exists( \'wpforms_get\' ) ){ wpforms_get( ' . $form->ID . ' ); }</code>';
             break;
         default:
             $value = '';
     }
     return apply_filters('wpforms_overview_table_column_value', $value, $form, $column_name);
 }
开发者ID:kixortillan,项目名称:dfosashworks,代码行数:35,代码来源:class-overview-table.php


示例2: get_modified_date

 public function get_modified_date()
 {
     if (!$this->id) {
         return '';
     }
     return date_i18n(get_option('date_format'), get_post_modified_time('U', false, $this->id));
 }
开发者ID:Nedick,项目名称:stzagora-website,代码行数:7,代码来源:class-listing.php


示例3: get_the_modified_date

	function get_the_modified_date($d = '') {
		if ( '' == $d )
			$the_time = get_post_modified_time(get_option('date_format'));
		else
			$the_time = get_post_modified_time($d);
		return apply_filters('get_the_modified_date', $the_time, $d);
	}
开发者ID:nunoluciano,项目名称:uxcl,代码行数:7,代码来源:functions_for_wp_old.php


示例4: create_sitemap

 /**
  * Function to create sitemap.xml file in root directory
  *
  */
 public function create_sitemap($post_id, $post, $update)
 {
     // only create a site map if the post is new or no file exists
     if (wp_is_post_revision($post_id) || is_file($this->path())) {
         // return false;
     }
     $post_types = get_post_types(array('public' => true, 'publicly_queryable' => true));
     $nodes = array();
     $posts = \Timber::get_posts(array('numberposts' => -1, 'orderby' => array('type', 'modified'), 'post_type' => $post_types, 'order' => 'DESC', 'post_status' => 'publish'));
     foreach ($posts as &$post) {
         $nodes[] = array('loc' => $post->link, 'lastmod' => get_post_modified_time('c', false, $post), 'changefreq' => $this->get_post_change_frequency($post), 'priority' => $this->get_priority($post));
     }
     $taxonomies = get_taxonomies(array('public' => true, 'publicly_queryable' => true));
     $terms = \Timber::get_terms(array('taxonomy' => $taxonomies, 'hide_empty' => false));
     foreach ($terms as &$term) {
         $lastest_post = $term->get_post(array('numberposts' => 1));
         $nodes[] = array('loc' => get_term_link($term), 'lastmod' => get_post_modified_time('c', false, $lastest_post), 'changefreq' => $this->change_frequency, 'priority' => $this->get_priority($term));
     }
     $data = array('nodes' => $nodes);
     $sitemap = \Timber::compile('sitemap-xml.twig', $data);
     $path = $this->path();
     if ($fp = fopen($path, 'w')) {
         fwrite($fp, $sitemap);
         fclose($fp);
     }
 }
开发者ID:benedict-w,项目名称:pressgang,代码行数:30,代码来源:sitemap.php


示例5: __construct

 /**
  * Get things started
  *
  * @access public
  * @since 2.7
  * @return void/
  */
 public function __construct($sub_id)
 {
     global $ninja_forms_fields;
     // Bail if the sub doesn't exist.
     $sub = get_post($sub_id);
     if (!is_object($sub)) {
         return false;
     }
     // Set our sub id
     $this->sub_id = $sub_id;
     // Populate our fields
     $this->fields = array();
     $this->retrieve_fields();
     // Setup our form id var
     $this->form_id = $this->get_meta('_form_id');
     // Setup our action var
     $this->action = $this->get_meta('_action');
     // Setup our sequential id
     $this->seq_num = $this->get_meta('_seq_num');
     // Setup our user_id var
     $this->user_id = $sub->post_author;
     // Setup our date submitted var
     $this->date_submitted = get_the_time('Y-m-d G:i:s', $sub_id);
     // Setup our date modified var
     $this->date_modified = get_post_modified_time('Y-m-d G:i:s', false, $sub_id);
 }
开发者ID:nihrain,项目名称:accelerate,代码行数:33,代码来源:sub.php


示例6: widget

    public function widget($args, $instance)
    {
        query_posts(array('post_type' => 'resource', 'posts_per_page' => 10));
        ?>

                    <ul>
                    <?php 
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                //Grab postmeta
                $post_meta = get_post_meta(get_the_ID());
                //print_r($post_meta); die();
                if ($post_meta[type][0] == 'External link') {
                    ?>

                    <li>
                    	<i class="fa fa-external-link" title="active"></i>
                        <h5><a href="<?php 
                    echo $post_meta[link_to_resource][0];
                    ?>
" target="_blank"><?php 
                    the_title();
                    ?>
</a></h5>
                        <p><span class="updated">Last updated <?php 
                    echo human_time_diff(get_post_modified_time('U', $post->ID), current_time('timestamp'));
                    ?>
 ago</span></p>
                    </li>
		    <?php 
                } else {
                    ?>

		    <li>
                    	<i class="fa fa-file" title="active"></i>
                        <h5><a href="<?php 
                    echo $post_meta[link_to_production_brief][0];
                    ?>
" target="_blank"><?php 
                    the_title();
                    ?>
</a></h5>
                        <p><span class="updated">Last updated <?php 
                    echo human_time_diff(get_post_modified_time('U', $post->ID), current_time('timestamp'));
                    ?>
 ago</span></p>
                    </li>
                    <?php 
                }
            }
            ?>

			</ul>

<?php 
        }
        wp_reset_query();
    }
开发者ID:mathewhtc,项目名称:cats-old,代码行数:59,代码来源:index.php


示例7: page_audit

 function page_audit($new_status, $old_status, $post)
 {
     error_log("Test");
     if ($new_status == 'trash') {
         $uid = get_current_user_id();
         $post_id = $ip = $date = get_post_modified_time();
         error_log("uuid: {$uid}");
     }
 }
开发者ID:amprog,项目名称:cap-audit,代码行数:9,代码来源:cap-audit.php


示例8: listing_page__get_the_modified_date

 public function listing_page__get_the_modified_date($the_date, $d = '')
 {
     if (!$this->listing_id) {
         return $the_date;
     }
     if (!$d) {
         $d = get_option('date_format');
     }
     //remove_filter( 'get_the_modified_date', array( &$this, 'listing_page__get_the_modified_date' ), 10, 2 );
     return get_post_modified_time($d, false, $this->listing_id, true);
 }
开发者ID:Nedick,项目名称:stzagora-website,代码行数:11,代码来源:class-page-meta.php


示例9: build_metadata

 private function build_metadata()
 {
     $metadata = array('@context' => 'http://schema.org', '@type' => 'BlogPosting', 'mainEntityOfPage' => get_permalink($this->ID), 'headline' => get_the_title($this->ID), 'datePublished' => get_the_date('c', $this->ID), 'dateModified' => get_post_modified_time('c', false, $this->post), 'author' => array('@type' => 'Person', 'name' => $this->author->display_name), 'publisher' => array('@type' => 'Organization', 'name' => get_bloginfo('name')));
     $post_image_id = $this->get_post_image_id();
     if ($post_image_id) {
         $post_image = wp_get_attachment_image_src($post_image_id, 'full');
         if ($post_image) {
             $metadata['image'] = array('@type' => 'ImageObject', 'url' => $post_image[0], 'width' => $post_image[1], 'height' => $post_image[2]);
         }
     }
     return $metadata;
 }
开发者ID:kantan2015,项目名称:amp-wp,代码行数:12,代码来源:class-amp-post.php


示例10: RecentRevisions

function RecentRevisions()
{
    global $wpdb;
    $widget_options = RecentRevisions_Options();
    $request = "SELECT {$wpdb->posts}.*, display_name as authorname " . "FROM {$wpdb->posts} LEFT JOIN {$wpdb->users} ON {$wpdb->posts}.post_author={$wpdb->users}.ID " . "WHERE (post_type='post' OR (post_type ='revision' AND post_name NOT LIKE '%-autosave')) " . "AND post_status IN('publish', 'inherit')";
    $request .= "ORDER BY post_modified_gmt DESC " . "LIMIT " . $widget_options['items'];
    $posts = $wpdb->get_results($request);
    // Use Date format of WP Preferences
    $date_format = get_option('date_format') . ' ' . get_option('time_format');
    if ($posts) {
        echo "\t\t\t\t<ul id='recent-revisions-list'>\n";
        foreach ($posts as $post) {
            $post_id = $post->post_type == 'post' ? $post->ID : $post->post_parent;
            //make the line
            $title = get_the_title($post_id);
            $post_meta = sprintf('%s', '<a href="post.php?post=' . $post_id . '&action=edit">' . ($title ? $title : __('(no title)')) . '</a> ');
            if ($widget_options['showauthor']) {
                $post_meta .= sprintf(__('by %s', 'recent-revisions'), '<strong>' . $post->authorname . '</strong> ');
            }
            if ($widget_options['showdatetime']) {
                //	$post_meta .= $post->post_modified_gmt;
                $post_meta .= sprintf(__('&#8212; %s', 'recent-revisions'), '' . get_post_modified_time($date_format, $widget_options['tz_gmt'], $post->ID, true));
                if ($widget_options['tz_gmt']) {
                    $post_meta .= ' GMT';
                }
            }
            if ($widget_options['showdiff']) {
                $request = "SELECT ID FROM {$wpdb->posts} WHERE post_type='revision' AND post_parent=" . $post_id . ' AND post_modified_gmt < "' . $post->post_modified_gmt . '" ORDER BY post_modified_gmt DESC LIMIT 1 ';
                $rev = $wpdb->get_row($request);
                if (is_null($rev)) {
                    // No previous revision found
                    $post_meta .= ' (' . __('new', 'recent-revisions') . ')';
                } else {
                    $prevId = $rev->ID;
                    $post_meta .= ' (<a href="revision.php?action=diff&post_type=page&right=' . $post->ID . '&left=' . $prevId . '">' . __('diff', 'recent-revisions') . '</a>)';
                }
            }
            //print it out
            ?>
<li class='post-meta'><?php 
            echo $post_meta;
            ?>
</li>
			<?php 
        }
        //end the line
        echo "</ul>\n";
        //but if you got no lines....
    } else {
        echo '<p>' . __("You don't have any revisions! Are revisions enabled in wp-config.php? Check that WP_POST_REVISIONS is true or >0. ", 'recent-revisions') . "</p>\n";
        //echo "<p> You don't have any revisions! Are revisions enabled in wp-config.php? Check that WP_POST_REVISIONS is true or >0. </p>\n";
    }
}
开发者ID:smoobs,项目名称:sjh,代码行数:53,代码来源:RecentRevisions.php


示例11: get_all_post_meta

 /**
  * Get all metadata for a post.
  *
  * @param \WP_Post $post The post.
  * @return array
  */
 public static function get_all_post_meta($post)
 {
     $tags = [['name' => 'description', 'content' => self::get_post_meta_description($post)], ['property' => 'og:locale', 'content' => get_locale()], ['property' => 'og:type', 'content' => 'article'], ['property' => 'og:title', 'content' => self::get_post_og_title($post)], ['property' => 'og:description', 'content' => self::get_post_og_description($post)], ['property' => 'og:url', 'content' => get_permalink($post->ID)], ['property' => 'og:site_name', 'content' => get_bloginfo('title')], ['property' => 'og:updated_time', 'content' => get_post_modified_time('c', true, $post)], ['name' => 'twitter:card', 'content' => self::get_twitter_card_type()], ['name' => 'twitter:title', 'content' => self::get_post_twitter_title($post)], ['name' => 'twitter:description', 'content' => self::get_post_twitter_description($post)]];
     $og_image = self::get_post_og_image($post);
     $twitter_image = self::get_post_twitter_image($post);
     if (!empty($og_image)) {
         $og_image_size = getimagesize($og_image);
         $tags = array_merge($tags, [['property' => 'og:image', 'content' => $og_image], ['property' => 'og:image:width', 'content' => $og_image_size[0]], ['property' => 'og:image:height', 'content' => $og_image_size[1]]]);
     }
     if (!empty($twitter_image)) {
         $twitter_image_size = getimagesize($twitter_image);
         $tags = array_merge($tags, [['name' => 'twitter:image', 'content' => $twitter_image], ['name' => 'twitter:image:width', 'content' => $twitter_image_size[0]], ['name' => 'twitter:image:height', 'content' => $twitter_image_size[1]]]);
     }
     $tags = array_merge($tags, Site::webmaster_tools());
     return ['title' => self::get_post_meta_title($post), 'tags' => $tags];
 }
开发者ID:moxie-lean,项目名称:wp-metadata,代码行数:22,代码来源:Post.php


示例12: build_post_data

 private function build_post_data()
 {
     $post_title = get_the_title($this->ID);
     $post_publish_timestamp = get_the_date('U', $this->ID);
     $post_modified_timestamp = get_post_modified_time('U', false, $this->post);
     $post_author = get_userdata($this->post->post_author);
     $this->add_data(array('post' => $this->post, 'post_id' => $this->ID, 'post_title' => $post_title, 'post_publish_timestamp' => $post_publish_timestamp, 'post_modified_timestamp' => $post_modified_timestamp, 'post_author' => $post_author));
     $metadata = array('@context' => 'http://schema.org', '@type' => 'BlogPosting', 'mainEntityOfPage' => $this->get('canonical_url'), 'publisher' => array('@type' => 'Organization', 'name' => $this->get('blog_name')), 'headline' => $post_title, 'datePublished' => date('c', $post_publish_timestamp), 'dateModified' => date('c', $post_modified_timestamp), 'author' => array('@type' => 'Person', 'name' => $post_author->display_name));
     $site_icon_url = $this->get('site_icon_url');
     if ($site_icon_url) {
         $metadata['publisher']['logo'] = array('@type' => 'ImageObject', 'url' => $site_icon_url, 'height' => self::SITE_ICON_SIZE, 'width' => self::SITE_ICON_SIZE);
     }
     $image_metadata = $this->get_post_image_metadata();
     if ($image_metadata) {
         $metadata['image'] = $image_metadata;
     }
     $this->add_data_by_key('metadata', apply_filters('amp_post_template_metadata', $metadata, $this->post));
 }
开发者ID:StudentLifeMarketingAndDesign,项目名称:krui-wp,代码行数:18,代码来源:class-amp-post-template.php


示例13: ubik_meta_date

function ubik_meta_date($format = '')
{
    // Get the time
    $published = get_post_time();
    $updated = get_post_modified_time();
    // Set the time zone offset
    $offset = (int) get_option('gmt_offset') * 60 * 60;
    if (empty($offset)) {
        $offset = 0;
    }
    // In case something goes horribly awry
    // Initialize variables
    $published_html = $updated_html = '';
    $published_class = 'published dt-published';
    // Microformats classes
    $updated_class = 'updated dt-updated';
    // No need to display updated when the timestamps are identical
    if ($published === $updated) {
        $updated = '';
    }
    // Grace period; allows for the used of the updated time instead of the published time when the difference is less than a specified time period (defaults to 3 hours)
    if (apply_filters('ubik_meta_date_grace_period', false) === true && !empty($updated)) {
        if ($updated - $published <= apply_filters('ubik_meta_date_grace_period_length', 10800)) {
            $published_class .= ' ' . $updated_class;
            $published = $updated;
            $updated = '';
        }
    }
    // Default format
    if (empty($format)) {
        $format = sprintf(_x('%1$s, %2$s', 'date, time', 'ubik'), get_option('date_format'), get_option('time_format'));
    }
    // Generate HTML output for both dates
    if (is_int($published)) {
        $published_display = apply_filters('ubik_meta_date_published', date($format, $published), $published);
        $published_html = '<time class="' . $published_class . '" itemprop="datePublished" datetime="' . date('c', $published - $offset) . '">' . $published_display . '</time>';
    }
    if (is_int($updated)) {
        $updated_display = apply_filters('ubik_meta_date_updated', date($format, $updated), $updated);
        $updated_html = '<time class="' . $updated_class . '" itemprop="dateModified" datetime="' . date('c', $updated - $offset) . '">' . $updated_display . '</time>';
    }
    // Populate the date array
    return apply_filters('ubik_meta_date', array('published' => apply_filters('ubik_meta_date_published_html', $published_html), 'updated' => apply_filters('ubik_meta_date_updated_html', $updated_html), 'published_raw' => $published, 'updated_raw' => $updated));
}
开发者ID:synapticism,项目名称:ubik-meta,代码行数:44,代码来源:ubik-meta-date.php


示例14: get_page_modified

 /**
  * Retrieves page date the same way it is retrieved in native panel :
  * see /wp-admin/includes/class-wp-posts-list-table.php 
  */
 private static function get_page_modified($post)
 {
     global $mode;
     if ('0000-00-00 00:00:00' == $post->post_modified) {
         $t_time = $h_time = __('Unpublished');
         $time_diff = 0;
     } else {
         $t_time = get_post_modified_time(__('Y/m/d g:i:s A'), false, $post, true);
         $m_time = $post->post_modified;
         $time = get_post_modified_time('G', true, $post);
         $time_diff = time() - $time;
         if ($time_diff >= 0 && $time_diff < DAY_IN_SECONDS) {
             $h_time = sprintf(__('%s ago'), human_time_diff($time));
         } else {
             $h_time = mysql2date(__('Y/m/d'), $m_time);
         }
     }
     $page_date = '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $post, 'apm-last-modified', $mode) . '</abbr>';
     return $page_date;
 }
开发者ID:CrankMaster336,项目名称:FFW-TR,代码行数:24,代码来源:last_modified_column.php


示例15: get_the_modified_time

/**
 * Retrieve the time at which the post was last modified.
 *
 * @since 2.0.0
 *
 * @param string $d Optional Either 'G', 'U', or php date format defaults to the value specified in the time_format option.
 * @return string
 */
function get_the_modified_time($d = '')
{
    if ('' == $d) {
        $the_time = get_post_modified_time(get_option('time_format'), null, null, true);
    } else {
        $the_time = get_post_modified_time($d, null, null, true);
    }
    return apply_filters('get_the_modified_time', $the_time, $d);
}
开发者ID:batruji,项目名称:metareading,代码行数:17,代码来源:general-template.php


示例16: foreach

			<b><?php 
    self::_e('Latest Updates');
    ?>
</b> 
			<ul>
				<?php 
    foreach ($estimates->posts as $estimate_id) {
        ?>
					<li><a href="<?php 
        echo get_edit_post_link($estimate_id);
        ?>
"><?php 
        echo get_the_title($estimate_id);
        ?>
</a> &mdash; <?php 
        echo date_i18n(get_option('date_format'), get_post_modified_time('U', false, $estimate_id));
        ?>
</li>
				<?php 
    }
    ?>
			</ul>
		<?php 
} else {
    ?>
			<p>
				<b><?php 
    self::_e('Latest Updates');
    ?>
</b><br/>
				<?php 
开发者ID:EfncoPlugins,项目名称:sprout-invoices,代码行数:31,代码来源:estimates.php


示例17: check_sync

 function check_sync()
 {
     // message
     if ($ids = acf_maybe_get($_GET, 'acfsynccomplete')) {
         // explode
         $ids = explode(',', $ids);
         $total = count($ids);
         if ($total == 1) {
             acf_add_admin_notice(sprintf(__('Field group synchronised. %s', 'acf'), '<a href="' . get_edit_post_link($ids[0]) . '">' . get_the_title($ids[0]) . '</a>'));
         } else {
             acf_add_admin_notice(sprintf(_n('%s field group synchronised.', '%s field groups synchronised.', $total, 'acf'), $total));
         }
     }
     // vars
     $groups = acf_get_field_groups();
     // bail early if no field groups
     if (empty($groups)) {
         return;
     }
     // find JSON field groups which have not yet been imported
     foreach ($groups as $group) {
         // vars
         $local = acf_maybe_get($group, 'local', false);
         $modified = acf_maybe_get($group, 'modified', 0);
         $private = acf_maybe_get($group, 'private', false);
         // ignore DB / PHP / private field groups
         if ($local !== 'json' || $private) {
             // do nothing
         } elseif (!$group['ID']) {
             $this->sync[$group['key']] = $group;
         } elseif ($modified && $modified > get_post_modified_time('U', true, $group['ID'], true)) {
             $this->sync[$group['key']] = $group;
         }
     }
     // bail if no sync needed
     if (empty($this->sync)) {
         return;
     }
     // import field group
     if ($key = acf_maybe_get($_GET, 'acfsync')) {
         // disable JSON
         // - this prevents a new JSON file being created and causing a 'change' to theme files - solves git anoyance
         acf_update_setting('json', false);
         // validate
         check_admin_referer('bulk-posts');
         // append fields
         if (acf_have_local_fields($key)) {
             $this->sync[$key]['fields'] = acf_get_local_fields($key);
         }
         // import
         $field_group = acf_import_field_group($this->sync[$key]);
         // redirect
         wp_redirect(admin_url($this->url . '&acfsynccomplete=' . $field_group['ID']));
         exit;
     } elseif (acf_maybe_get($_GET, 'action2') === 'acfsync') {
         // validate
         check_admin_referer('bulk-posts');
         // get ids
         $keys = acf_maybe_get($_GET, 'post');
         if (!empty($keys)) {
             // disable JSON
             // - this prevents a new JSON file being created and causing a 'change' to theme files - solves git anoyance
             acf_update_setting('json', false);
             // vars
             $new_ids = array();
             foreach ($keys as $key) {
                 // append fields
                 if (acf_have_local_fields($key)) {
                     $this->sync[$key]['fields'] = acf_get_local_fields($key);
                 }
                 // import
                 $field_group = acf_import_field_group($this->sync[$key]);
                 // append
                 $new_ids[] = $field_group['ID'];
             }
             // redirect
             wp_redirect(admin_url($this->url . '&acfsynccomplete=' . implode(',', $new_ids)));
             exit;
         }
     }
     // filters
     add_filter('views_edit-acf-field-group', array($this, 'list_table_views'));
 }
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:83,代码来源:field-groups.php


示例18: get_the_field


//.........这里部分代码省略.........
             }
             break;
         case 'author-id':
             $result = $post->post_author;
             break;
         case 'author-url':
             $result = get_author_posts_url($post->post_author);
             break;
         case 'author-login':
             $author_id = $post->post_author;
             $result = do_shortcode('[users id=' . $author_id . '][user name][/users]');
             break;
         case 'avatar':
             if (!empty($parameters['size'])) {
                 $result = get_avatar($post->post_author, $parameters['size']);
             } else {
                 $result = get_avatar($post->post_author);
             }
             break;
         case 'date':
             if (!empty($parameters['date_format'])) {
                 if ($parameters['date_format'] == 'relative') {
                     $result = CCS_Format::get_relative_date($post->post_date);
                 } else {
                     $result = mysql2date($parameters['date_format'], $post->post_date);
                 }
             } else {
                 // Default date format under Settings -> General
                 $result = mysql2date(get_option('date_format'), $post->post_date);
             }
             break;
         case 'modified':
             if (!empty($parameters['date_format'])) {
                 $result = get_post_modified_time($parameters['date_format'], $gmt = false, $post_id, $translate = true);
             } else {
                 // Default date format under Settings -> General
                 $result = get_post_modified_time(get_option('date_format'), $gmt = false, $post_id, $translate = true);
             }
             break;
         case 'image-full':
             $parameters['size'] = 'full';
         case 'image':
             // image
         // image
         case 'image-link':
             // image with link to post
         // image with link to post
         case 'image-link-self':
             // image with link to attachment page
             $parameters['size'] = isset($parameters['size']) && !empty($parameters['size']) ? $parameters['size'] : 'full';
             if (empty($attr['alt'])) {
                 $attr['alt'] = self::wp_get_featured_image_field($post_id, 'alt');
             }
             $result = get_the_post_thumbnail($post_id, $parameters['size'], $attr);
             break;
         case 'image-url':
             $parameters['size'] = isset($parameters['size']) && !empty($parameters['size']) ? $parameters['size'] : 'full';
             $src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $parameters['size']);
             $result = $src['0'];
             // $result = wp_get_attachment_url(get_post_thumbnail_id($post_id));
             break;
         case 'image-title':
         case 'image-caption':
         case 'image-alt':
         case 'image-description':
             $image_field_name = substr($field, 6);
开发者ID:surreal8,项目名称:wptheme,代码行数:67,代码来源:content.php


示例19: array

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<?php 
$query_args = array('post_type' => array('post', 'page', 'front-matter', 'part', 'chapter', 'back-matter'), 'post_status' => 'publish', 'orderby' => 'date', 'posts_per_page' => 50000);
query_posts($query_args);
if (have_posts()) {
    while (have_posts()) {
        the_post();
        // Skip example pages
        if ('page' == $post->post_type && 'sample-page' == $post->post_name) {
            continue;
        } elseif ('page' == $post->post_type && 'access-denied' == $post->post_name) {
            continue;
        } elseif ('post' == $post->post_type && 'hello-world' == $post->post_name) {
            continue;
        }
        ?>
		<url>
			<loc><?php 
        echo get_permalink($post->ID);
        ?>
</loc>
			<lastmod><?php 
        echo mysql2date('Y-m-d', get_post_modified_time('Y-m-d H:i:s', true), false);
        ?>
</lastmod>
		</url>
	<?php 
    }
}
?>
</urlset>
开发者ID:cumi,项目名称:pressbooks,代码行数:31,代码来源:pb-sitemap.php


示例20: acf_write_json_field_group

function acf_write_json_field_group($field_group)
{
    // vars
    $path = acf_get_setting('save_json');
    $file = $field_group['key'] . '.json';
    // remove trailing slash
    $path = untrailingslashit($path);
    // bail early if dir does not exist
    if (!is_writable($path)) {
        return false;
    }
    // prepare for export
    $id = acf_extract_var($field_group, 'ID');
    $field_group = acf_prepare_field_group_for_export($field_group);
    // add modified time
    $field_group['modified'] = get_post_modified_time('U', true, $id, true);
    // write file
    $f = fopen("{$path}/{$file}", 'w');
    fwrite($f, acf_json_encode($field_group));
    fclose($f);
    // return
    return true;
}
开发者ID:rousnay,项目名称:lighthouse,代码行数:23,代码来源:json.php



注:本文中的get_post_modified_time函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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