Genesis', 'agentpress-listings' ), array( 'a' => array( 'href' => array(), ), ) ), 'http://my.studiopress.com/themes/genesis/' ) ); } if ( version_compare( wp_get_theme( 'genesis' )->get( 'Version' ), $latest, '<' ) ) { // Deactivate ourself. deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */ // translators: %1$s is the link and %2$s is the version. wp_die( sprintf( wp_kses( // translators: %1$s is the link and %2$s is the version. __( 'Sorry, you cannot activate without Genesis %2$s or greater', 'agentpress-listings' ), array( 'a' => array( 'href' => array(), ), ) ), 'http://www.studiopress.com/support/showthread.php?t=19576', esc_html( $latest ) ) ); } /** Flush rewrite rules */ if ( ! post_type_exists( 'listing' ) ) { agentpress_listings_init(); global $_agentpress_listings, $_agentpress_taxonomies; $_agentpress_listings->create_post_type(); $_agentpress_taxonomies->register_taxonomies(); } flush_rewrite_rules(); } add_action( 'after_setup_theme', 'agentpress_listings_init' ); /** * Initialize AgentPress Listings. * * Include the libraries, define global variables, instantiate the classes. * * @since 0.1.0 */ function agentpress_listings_init() { /** Do nothing if a Genesis child theme isn't active */ if ( ! function_exists( 'genesis_get_option' ) ) { return; } global $_agentpress_listings, $_agentpress_taxonomies; define( 'APL_URL', plugin_dir_url( __FILE__ ) ); define( 'APL_VERSION', '1.3.2' ); /** Load textdomain for translation */ load_plugin_textdomain( 'agentpress-listings', false, basename( dirname( __FILE__ ) ) . '/languages/' ); /** Includes */ require_once dirname( __FILE__ ) . '/includes/functions.php'; require_once dirname( __FILE__ ) . '/includes/class-agentpress-listings.php'; require_once dirname( __FILE__ ) . '/includes/class-agentpress-taxonomies.php'; require_once dirname( __FILE__ ) . '/includes/class-agentpress-featured-listings-widget.php'; require_once dirname( __FILE__ ) . '/includes/class-agentpress-listings-search-widget.php'; /** Instantiate */ $_agentpress_listings = new AgentPress_Listings(); $_agentpress_taxonomies = new AgentPress_Taxonomies(); add_action( 'widgets_init', 'agentpress_register_widgets' ); } /** * Register Widgets that will be used in the AgentPress Listings plugin * * @since 0.1.0 */ function agentpress_register_widgets() { $widgets = array( 'AgentPress_Featured_Listings_Widget', 'AgentPress_Listings_Search_Widget' ); foreach ( (array) $widgets as $widget ) { register_widget( $widget ); } }