Ejemplo n.º 1
0
/**
 * Returns the project end_date.
 *
 * @since  1.0.0
 * @access public
 * @param  array  $args
 * @return string
 */
function ccp_get_project_end_date($args = array())
{
    $html = '';
    $defaults = array('post_id' => ccp_get_project_id(), 'text' => '%s', 'format' => get_option('date_format'), 'before' => '', 'after' => '', 'wrap' => '<span %s>%s</span>');
    $args = wp_parse_args($args, $defaults);
    $end_date = ccp_get_project_meta($args['post_id'], 'end_date');
    if ($end_date) {
        $datetime = sprintf('datetime="%s"', mysql2date('Y-m-d\\TH:i:sP', $end_date, true));
        $text = sprintf('<time class="project-data" %s>%s</time>', $datetime, mysql2date($args['format'], $end_date, true));
        $text = sprintf($args['text'], $text);
        $html .= $args['before'];
        $html .= sprintf($args['wrap'], 'class="project-end-date"', $text);
        $html .= $args['after'];
    }
    return apply_filters('ccp_get_project_end_date', $html, $args['post_id']);
}
 /**
  * Gets the value of the setting.
  *
  * @since  1.0.0
  * @access public
  * @return mixed
  */
 public function get_value($post_id)
 {
     return ccp_get_project_meta($post_id, $this->name);
 }