当前位置: 首页>>代码示例>>PHP>>正文


PHP the_author_ID函数代码示例

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


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

示例1: display_page_row


//.........这里部分代码省略.........

	case 'cb':
		?>
		<th scope="row" class="check-column"><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /></th>
		<?php
		break;
	case 'date':
		if ( '0000-00-00 00:00:00' == $page->post_date && 'date' == $column_name ) {
			$t_time = $h_time = __('Unpublished');
		} else {
			$t_time = get_the_time(__('Y/m/d g:i:s A'));
			$m_time = $page->post_date;
			$time = get_post_time('G', true);

			if ( ( abs(time() - $time) ) < 86400 ) {
				if ( ( 'future' == $page->post_status) )
					$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
				else
					$h_time = sprintf( __('%s ago'), human_time_diff( $time ) );
			} else {
				$h_time = mysql2date(__('Y/m/d'), $m_time);
			}
		}
		echo '<td ' . $attributes . '>';
		echo '<abbr title="' . $t_time . '">' . apply_filters('post_date_column_time', $h_time, $page, $column_name, '') . '</abbr>';
		echo '<br />';
		if ( 'publish' == $page->post_status || 'future' == $page->post_status )
			_e('Published');
		else
			_e('Last Modified');
		echo '</td>';
		break;
	case 'title':
		$attributes = 'class="post-title page-title column-title"' . $style;
		$edit_link = get_edit_post_link( $page->ID );
		?>
		<td <?php echo $attributes ?>><strong><?php if ( current_user_can( 'edit_post', $page->ID ) ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); ?></strong>
		<?php
		$actions = array();
		if ( current_user_can('edit_page', $page->ID) ) {
			$actions['edit'] = '<a href="' . $edit_link . '" title="' . attribute_escape(__('Edit this page')) . '">' . __('Edit') . '</a>';
			$actions['inline'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
			$actions['delete'] = "<a class='submitdelete' title='" . attribute_escape(__('Delete this page')) . "' href='" . wp_nonce_url("page.php?action=delete&amp;post=$page->ID", 'delete-page_' . $page->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $page->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $page->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
		}
		if ( in_array($post->post_status, array('pending', 'draft')) ) {
			if ( current_user_can('edit_page', $page->ID) )
				$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('Preview "%s"'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
		} else {
			$actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
		}
		$action_count = count($actions);

		$i = 0;
		echo '<div class="row-actions">';
		foreach ( $actions as $action => $link ) {
			++$i;
			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
			echo "<span class='$action'>$link$sep</span>";
		}
		echo '</div>';

		get_inline_data($post);
		echo '</td>';
		break;

	case 'comments':
		?>
		<td <?php echo $attributes ?>><div class="post-com-count-wrapper">
		<?php
		$left = get_pending_comments_num( $page->ID );
		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
		if ( $left )
			echo '<strong>';
		comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
		if ( $left )
			echo '</strong>';
		?>
		</div></td>
		<?php
		break;

	case 'author':
		?>
		<td <?php echo $attributes ?>><a href="edit-pages.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
		<?php
		break;

	default:
		?>
		<td <?php echo $attributes ?>><?php do_action('manage_pages_custom_column', $column_name, $id); ?></td>
		<?php
		break;
	}
}
?>

</tr>

<?php
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:101,代码来源:template.php

示例2: the_title

        ?>
" rel="bookmark"><?php 
        the_title();
        ?>
</a></h2>
				<h5><?php 
        _e("Posted in");
        ?>
 <?php 
        the_category(',');
        ?>
 by <a href="<?php 
        get_bloginfo('site_url');
        ?>
?author=<?php 
        the_author_ID();
        ?>
"><?php 
        the_author();
        ?>
</a>. <?php 
        the_date();
        ?>
, <?php 
        the_time();
        ?>
. <?php 
        the_tags(__('Tags: '), ', ', ' &#8212; ');
        ?>
</h5>
				<div class="page-content">
开发者ID:stas,项目名称:libertine,代码行数:31,代码来源:archive.php

示例3: get_pending_comments_num

		<?php
		$left = get_pending_comments_num( $post->ID );
		$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
		if ( $left )
			echo '<strong>';
		comments_number("<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
		if ( $left )
			echo '</strong>';
		?>
		</div></td>
		<?php
		break;

	case 'author':
		?>
		<td><a href="edit.php?author=<?php the_author_ID(); ?>"><?php the_author() ?></a></td>
		<?php
		break;

	case 'status':
		?>
		<td>
		<a href="<?php the_permalink(); ?>" title="<?php echo attribute_escape(sprintf(__('View "%s"'), $title)); ?>" rel="permalink">
		<?php
		switch ( $post->post_status ) {
			case 'publish' :
			case 'private' :
				_e('Published');
				break;
			case 'future' :
				_e('Scheduled');
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:31,代码来源:edit-post-rows.php

示例4: display_page_row


//.........这里部分代码省略.........
                ?>
</abbr></td>
		<?php 
                break;
            case 'title':
                ?>
		<td><strong><a class="row-title" href="page.php?action=edit&amp;post=<?php 
                the_ID();
                ?>
" title="<?php 
                echo attribute_escape(sprintf(__('Edit "%s"'), $title));
                ?>
"><?php 
                echo $pad;
                echo $title;
                ?>
</a></strong>
		<?php 
                if ('private' == $page->post_status) {
                    _e(' &#8212; <strong>Private</strong>');
                }
                ?>
</td>
		<?php 
                break;
            case 'comments':
                ?>
		<td class="num"><div class="post-com-count-wrapper">
		<?php 
                $left = get_pending_comments_num($page->ID);
                $pending_phrase = sprintf(__('%s pending'), number_format($left));
                if ($left) {
                    echo '<strong>';
                }
                comments_number("<a href='edit-pages.php?page_id={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-pages.php?page_id={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-pages.php?page_id={$id}' title='{$pending_phrase}' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
                if ($left) {
                    echo '</strong>';
                }
                ?>
		</div></td>
		<?php 
                break;
            case 'author':
                ?>
		<td><a href="edit-pages.php?author=<?php 
                the_author_ID();
                ?>
"><?php 
                the_author();
                ?>
</a></td>
		<?php 
                break;
            case 'status':
                ?>
		<td>
		<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                echo attribute_escape(sprintf(__('View "%s"'), $title));
                ?>
" rel="permalink">
		<?php 
                switch ($page->post_status) {
                    case 'publish':
                    case 'private':
                        _e('Published');
                        break;
                    case 'future':
                        _e('Scheduled');
                        break;
                    case 'pending':
                        _e('Pending Review');
                        break;
                    case 'draft':
                        _e('Unpublished');
                        break;
                }
                ?>
		</a>
		</td>
		<?php 
                break;
            default:
                ?>
		<td><?php 
                do_action('manage_pages_custom_column', $column_name, $id);
                ?>
</td>
		<?php 
                break;
        }
    }
    ?>

   </tr>

<?php 
}
开发者ID:nurpax,项目名称:saastafi,代码行数:101,代码来源:template.php

示例5: prologue_latest_posts

function prologue_latest_posts()
{
    $load_time = $_GET['load_time'];
    $frontpage = $_GET['frontpage'];
    $num_posts = 10;
    //max amount of posts to load
    $number_of_new_posts = 0;
    $prologue_query = new WP_Query('showposts=' . $num_posts . '&post_status=publish');
    ob_start();
    while ($prologue_query->have_posts()) {
        $prologue_query->the_post();
        if (get_gmt_from_date(get_the_time('Y-m-d H:i:s')) <= $load_time) {
            continue;
        }
        $number_of_new_posts++;
        if ($frontpage) {
            ?>
<li id="prologue-<?php 
            the_ID();
            ?>
" class="newupdates user_id_<?php 
            the_author_ID();
            ?>
">


<?php 
            $current_user_id = get_the_author_ID();
            echo prologue_get_avatar($current_user_id, get_the_author_email(), 48);
            ?>

<?php 
        }
    }
    $posts_html = ob_get_contents();
    ob_end_clean();
    if ($number_of_new_posts == 0) {
        echo 0;
        exit;
    } else {
        $json_data = array("numberofnewposts" => $number_of_new_posts, "html" => $posts_html, "lastposttime" => gmdate('Y-m-d H:i:s'));
        echo json_encode($json_data);
    }
    exit;
}
开发者ID:Br3nda,项目名称:openmicroblogger,代码行数:45,代码来源:functions.php

示例6: prologue_latest_posts

function prologue_latest_posts()
{
    $load_time = $_GET['load_time'];
    $frontpage = $_GET['frontpage'];
    $num_posts = 10;
    //max amount of posts to load
    $number_of_new_posts = 0;
    $prologue_query = new WP_Query('showposts=' . $num_posts . '&post_status=publish');
    ob_start();
    while ($prologue_query->have_posts()) {
        $prologue_query->the_post();
        $current_user_id = get_the_author_ID();
        if (get_gmt_from_date(get_the_time('Y-m-d H:i:s')) <= $load_time) {
            continue;
        }
        $number_of_new_posts++;
        if ($frontpage) {
            ?>
<li id="prologue-<?php 
            the_ID();
            ?>
" class="newupdates user_id_<?php 
            the_author_ID();
            ?>
">
    <?php 
            echo prologue_get_avatar($current_user_id, get_the_author_email(), 48);
            ?>
    <h4>
		<?php 
            the_author_posts_link();
            ?>
		<span class="meta">
		    <?php 
            printf(__('%s <em>on</em> %s', 'p2'), get_the_time(), get_the_time(get_option('date_format')));
            ?>
 |
			<?php 
            comments_popup_link('0', '1', '%');
            ?>
			
			<span class="actions">
				<a href="<?php 
            the_permalink();
            ?>
" class="thepermalink"><?php 
            _e('Permalink', 'p2');
            ?>
</a>
			<?php 
            if (function_exists('post_reply_link')) {
                echo post_reply_link(array('before' => ' | ', 'reply_text' => __('Reply', 'p2'), 'add_below' => 'prologue'), get_the_id());
            }
            ?>
			<?php 
            if (current_user_can('edit_post', get_the_id())) {
                ?>
			|  <a href="<?php 
                echo get_edit_post_link(get_the_id());
                ?>
" class="post-edit-link" rel="<?php 
                the_ID();
                ?>
"><?php 
                _e('Edit', 'p2');
                ?>
</a>
			<?php 
            }
            ?>
			</span>
			<br />
			<?php 
            tags_with_count('', __('Tags:', 'p2') . ' ', ', ', ' ');
            ?>
		</span>
	</h4>
	<div class="postcontent<?php 
            if (current_user_can('edit_post', get_the_id())) {
                ?>
 editarea<?php 
            }
            ?>
" id="content-<?php 
            the_ID();
            ?>
"><?php 
            the_content(__('(More ...)', 'p2'));
            ?>
</div> <!-- // postcontent -->
	<div class="bottom_of_entry">&nbsp;</div>
</li>
<?php 
        }
    }
    $posts_html = ob_get_contents();
    ob_end_clean();
    if ($number_of_new_posts == 0) {
        echo '0';
    } else {
//.........这里部分代码省略.........
开发者ID:enlamp,项目名称:enlamp.cn,代码行数:101,代码来源:functions.php

示例7: prayer_page

function prayer_page()
{
    global $post;
    global $wpdb;
    $page_id = $_POST['page_id'];
    $pid = $_POST['pid'];
    $paged = get_query_var('paged') ? get_query_var('paged') : $page_id;
    $offset_value = $paged * get_option('posts_per_page');
    //$args = array( 'cat' => $categoryname,'order'=>'ASC','posts_per_page'=>'6','paged'=>$paged,'offset'=>$offset_value);
    if ($pid != "") {
        $args = array('post_type' => 'post', 'orderby' => 'post_date', 'paged' => $paged, 'offset' => $offset_value, 'post__in' => $pid);
    }
    query_posts($args);
    while (have_posts()) {
        the_post();
        //$normal_image = wp_get_attachment_url( get_post_thumbnail_id() );
        //$normal_image = get_field("normal_image");
        ?>
			  				 <section>
                                  <div class="image-main ff-left">
                                  	<a href="<?php 
        the_permalink();
        ?>
" title="">
                                         <?php 
        if (has_post_thumbnail()) {
            the_post_thumbnail('custom-size');
        } else {
            ?>
													  <img src="<?php 
            echo get_template_directory_uri();
            ?>
/library/images/pray-img-1.jpg">
										 <?php 
        }
        ?>
 
										 </a>
                                        <div class="img-des">
                                             <ul>
                                            	<?php 
        $url = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'thumbnail'));
        ?>
                                            	<?php 
        $postid = get_the_ID();
        ?>
 
                                            	   <!-- <li><span class="share"></span></li> -->
                                                 <li>
                                                	<a class="fb" href="http://www.facebook.com/sharer.php?s=100&p[title]=<?php 
        the_title();
        ?>
&p[url]=<?php 
        the_permalink();
        ?>
&p[summary]=<?php 
        echo get_post_field('post_content', $postid);
        ?>
&p[images][0]=<?php 
        echo $url;
        ?>
" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;" title="Facebook"></a>
                                                </li>
                                                 <li>
                                                	<a class="twt" href="http://twitter.com/home?status=<?php 
        the_title();
        ?>
+<?php 
        the_permalink();
        ?>
+<?php 
        echo substr($post->post_content, 0, 80);
        ?>
" onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=no,scrollbars=no,height=400,width=600');return false;" title="Twitter"></a>
	                            				</li>
                                                <li>
                                                	<a class="gp"  href="https://plus.google.com/share?url=<?php 
        the_permalink();
        ?>
" onclick="javascript:window.open(this.href,'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=600');return false;" title="Google+"></a>
                                                </li>
                                            </ul>
                                            <!-- <p>I’m telling my friends to pray</p> -->
                                        </div>
                                    </div>
                                    <div class="user-detail ff-left" id="<?php 
        the_author_ID();
        ?>
">
                                    	
                                    		<!----user avtar---->
									<?php 
        $authore_id = get_the_author_meta('ID');
        ?>
									<?php 
        $provider = get_the_author_meta("wsl_current_provider", $authore_id);
        ?>
									
									<?php 
        if ($provider == "") {
//.........这里部分代码省略.........
开发者ID:nagyistoce,项目名称:krunalsojitra-wp-themes,代码行数:101,代码来源:functions.php

示例8: postinfo

function postinfo($postinfo_string)
{
    // one theme option needed below for nofollow trackback / RSS links yes/no
    global $bfa_ata, $post;
    /* replace date format escape placeholders(#) with the actual escpae
    	character (=backslashes). This function removes all backslashes from
    	post info strings to avoid issues with hosts that have magic_quotes_gpc ON.
    	But we want to keep the backslashes inside date items, because they are
    	needed to escape literal strings inside dates */
    $postinfo_string = str_replace("#", "\\", $postinfo_string);
    $postinfo = $postinfo_string;
    // Author public name
    if (strpos($postinfo_string, '%author%') !== FALSE) {
        ob_start();
        the_author();
        $author = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author%", $author, $postinfo);
    }
    // Public name of Author who last modified a post, since WordPress 2.8.
    // Check first if function is available (= if this is WP 2.8+)
    if (function_exists('the_modified_author')) {
        if (strpos($postinfo_string, '%modified-author%') !== FALSE) {
            ob_start();
            the_modified_author();
            $modified_author = ob_get_contents();
            ob_end_clean();
            $postinfo = str_replace("%modified-author%", $modified_author, $postinfo);
        }
    }
    // Author about yourself
    if (strpos($postinfo_string, '%author-description%') !== FALSE) {
        ob_start();
        the_author_description();
        $author_description = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-description%", $author_description, $postinfo);
    }
    // Author login name
    if (strpos($postinfo_string, '%author-login%') !== FALSE) {
        ob_start();
        the_author_login();
        $author_login = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-login%", $author_login, $postinfo);
    }
    // Author first name
    if (strpos($postinfo_string, '%author-firstname%') !== FALSE) {
        ob_start();
        the_author_firstname();
        $author_firstname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-firstname%", $author_firstname, $postinfo);
    }
    // Author last name
    if (strpos($postinfo_string, '%author-lastname%') !== FALSE) {
        ob_start();
        the_author_lastname();
        $author_lastname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-lastname%", $author_lastname, $postinfo);
    }
    // Author nickname
    if (strpos($postinfo_string, '%author-nickname%') !== FALSE) {
        ob_start();
        the_author_nickname();
        $author_nickname = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-nickname%", $author_nickname, $postinfo);
    }
    // Author ID
    if (strpos($postinfo_string, '%author-id%') !== FALSE) {
        ob_start();
        the_author_ID();
        $author_ID = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-id%", $author_ID, $postinfo);
    }
    // Author email address, clear text in HTML source code
    if (strpos($postinfo_string, '%author-email-clear%') !== FALSE) {
        ob_start();
        the_author_email();
        $author_email_clear = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-email-clear%", $author_email_clear, $postinfo);
    }
    // Author email address obfuscated
    if (strpos($postinfo_string, '%author-email%') !== FALSE) {
        $postinfo = str_replace("%author-email%", antispambot(get_the_author_email()), $postinfo);
    }
    // Author website URL
    if (strpos($postinfo_string, '%author-url%') !== FALSE) {
        ob_start();
        the_author_url();
        $author_url = ob_get_contents();
        ob_end_clean();
        $postinfo = str_replace("%author-url%", $author_url, $postinfo);
    }
    // Author website link
    if (strpos($postinfo_string, '%author-link%') !== FALSE) {
//.........这里部分代码省略.........
开发者ID:billerby,项目名称:Surdeg,代码行数:101,代码来源:bfa_postinfo.php

示例9: esc_attr

                if (get_the_author_ID() != $current_user->ID && !is_super_admin()) {
                    echo '<p><b>Sorry, you are not the author of this wish o delete it.<br />
                Delete your own Wish ..</b></p>';
                    return;
                }
                ?>
 
        <div class="wrap">
          <h3>Delete Your Wish</h3>
          <form name="wishdelete" method="post">
            <input type="hidden" name="wish_id" value="<?php 
                echo esc_attr($post_id);
                ?>
" /> 
            <input type="hidden" name="wisher_id" value="<?php 
                echo esc_attr(the_author_ID());
                ?>
" />            
            <p>Are you sure you want to delete <b>"<?php 
                the_title();
                ?>
"</b> wish?</p>
            <input type="submit" name="cancel_Wish" value="No" />
            <input type="submit" name="delete_Wish" value="Yes" />            
          </form> 
        </div>  
<?php 
                break;
            default:
                ?>
                                                    				
开发者ID:par-orillonsoft,项目名称:Wishmagnet,代码行数:30,代码来源:single.php


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