コード例 #1
0
 /**
  * publish_post function.
  * 
  * @access public
  * @return void
  */
 function publish_post($postId = 0)
 {
     include_once $this->plugin_base . '/classes/util/WPSDAutoPost.php';
     if ($postId > 0) {
         $form = new WPSDAdminConfigForm();
         $ap = new WPSDAutoPost();
         //$ap->setAmplifyEmail($form->getWpsdAmplifyAutoPostEmail());
         $ap->setPosterousEmail($form->getWpsdPosterousAutoPostEmail());
         $post = get_post($postId);
         if (null != $post) {
             $autoposted = get_post_meta($post->ID, 'wpsd_autopost', true);
             if (!$autoposted && $ap->post($post->post_title, $post->post_excerpt . ' <br/><br/> <a href="' . get_permalink($postId) . '" target="_blank" rel="follow">' . __('Read more', 'wpsd') . '</a>', get_bloginfo('admin_email'))) {
             }
             update_post_meta($post->ID, 'wpsd_autopost', 1);
         }
     }
 }