function test_class_access()
 {
     $sermons = gc_sermons()->sermons;
     $this->assertFalse($sermons->most_recent());
     $this->assertEquals('gc-sermons', $sermons->post_type());
     // Create a post
     $this->factory->post->create(array('post_type' => $sermons->post_type()));
     $sermons->flush = true;
     // And check if we found an instance
     $this->assertTrue($sermons->most_recent() instanceof GCS_Sermon_Post);
 }
 /**
  * Initate the taxonomy.
  *
  * @since  0.1.0
  *
  * @param  string  $taxonomy Taxonomy to initiate
  *
  * @return array             Array of terms for this taxonomy.
  */
 protected function init_taxonomy($taxonomy)
 {
     $tax_slug = gc_sermons()->taxonomies->{$taxonomy}->taxonomy();
     return get_the_terms($this->ID, $tax_slug);
 }
Beispiel #3
0
 function test_class_access()
 {
     $this->assertTrue(gc_sermons()->async instanceof GCS_Async);
 }
Beispiel #4
0
/**
 * Gets a GCS_Scripture augmented term object from a term object or ID.
 *
 * @since  0.1.7
 *
 * @param  mixed $term Term object or ID.
 * @param  array       $args Array of arguments.
 *
 * @return GCS_Scripture|false GCS_Scripture object if successful.
 */
function gc_get_scripture_object($term = 0, $args = array())
{
    if (!$term) {
        $term = is_tax(gc_sermons()->taxonomies->scripture->taxonomy()) ? get_queried_object() : 0;
    }
    if ($term) {
        return gc_sermons()->taxonomies->scripture->get($term, $args);
    }
    return false;
}
Beispiel #5
0
            case 'version':
                return self::VERSION;
            case 'sermons':
            case 'taxonomies':
            case 'shortcodes':
                return $this->{$field};
            case 'series':
            case 'speaker':
            case 'topic':
            case 'tag':
                return $this->taxonomies->{$field};
            default:
                throw new Exception('Invalid ' . __CLASS__ . ' property: ' . $field);
        }
    }
}
/**
 * Grab the GC_Sermons_Plugin object and return it.
 * Wrapper for GC_Sermons_Plugin::get_instance()
 *
 * @since  0.1.0
 * @return GC_Sermons_Plugin  Singleton instance of plugin class.
 */
function gc_sermons()
{
    return GC_Sermons_Plugin::get_instance();
}
// Kick it off.
add_action('plugins_loaded', array(gc_sermons(), 'hooks'));
register_activation_hook(__FILE__, array('GC_Sermons_Plugin', 'activate'));
register_deactivation_hook(__FILE__, array('GC_Sermons_Plugin', 'deactivate'));
 function test_class_access()
 {
     $this->assertTrue(gc_sermons()->series instanceof GCS_Series);
 }
Beispiel #7
0
 function test_get_instance()
 {
     $this->assertTrue(gc_sermons() instanceof GC_Sermons_Plugin);
 }
 function test_class_access()
 {
     $this->assertTrue(gc_sermons()->taxonomies instanceof GCS_Taxonomies);
 }
 function test_class_access()
 {
     $this->assertTrue(gc_sermons()->speaker instanceof GCS_Speaker);
 }
 function test_class_access()
 {
     gc_sermons()->hooks();
     $this->assertTrue(gc_sermons()->shortcodes instanceof GCS_Shortcodes);
 }