Import and Export functionality will be implemented here.
+
+ [ self::class, 'sanitize' ] ] // Sanitize callback
+ );
+
+ add_settings_section(
+ 'wpfa_general_settings_section', // ID
+ 'General Settings', // Title
+ null, // Callback
+ 'wpfa_settings' // Page
+ );
+
+ // Add fields here in the future.
+ }
+
+ /**
+ * Sanitize each setting field as needed.
+ *
+ * @param array $input Contains all settings fields as array keys.
+ * @return array
+ */
+ public static function sanitize( $input ) {
+ $new_input = [];
+ // Example for a future field:
+ // if ( isset( $input['some_field'] ) ) {
+ // $new_input['some_field'] = sanitize_text_field( $input['some_field'] );
+ // }
+ return $input; // Return sanitized input.
+ }
+}
\ No newline at end of file
diff --git a/includes/class-wpfaevent-activator.php b/includes/class-wpfaevent-activator.php
deleted file mode 100644
index 3a36f3b..0000000
--- a/includes/class-wpfaevent-activator.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- */
-class Wpfaevent_Activator {
-
- /**
- * Short Description. (use period)
- *
- * Long Description.
- *
- * @since 1.0.0
- */
- public static function activate() {
-
- }
-
-}
diff --git a/includes/class-wpfaevent-deactivator.php b/includes/class-wpfaevent-deactivator.php
deleted file mode 100644
index 5ef477b..0000000
--- a/includes/class-wpfaevent-deactivator.php
+++ /dev/null
@@ -1,36 +0,0 @@
-
- */
-class Wpfaevent_Deactivator {
-
- /**
- * Short Description. (use period)
- *
- * Long Description.
- *
- * @since 1.0.0
- */
- public static function deactivate() {
-
- }
-
-}
diff --git a/includes/class-wpfaevent-i18n.php b/includes/class-wpfaevent-i18n.php
deleted file mode 100644
index 3eac493..0000000
--- a/includes/class-wpfaevent-i18n.php
+++ /dev/null
@@ -1,47 +0,0 @@
-
- */
-class Wpfaevent_i18n {
-
-
- /**
- * Load the plugin text domain for translation.
- *
- * @since 1.0.0
- */
- public function load_plugin_textdomain() {
-
- load_plugin_textdomain(
- 'wpfaevent',
- false,
- dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
- );
-
- }
-
-
-
-}
diff --git a/includes/class-wpfaevent-loader.php b/includes/class-wpfaevent-loader.php
deleted file mode 100644
index abebcbd..0000000
--- a/includes/class-wpfaevent-loader.php
+++ /dev/null
@@ -1,129 +0,0 @@
-
- */
-class Wpfaevent_Loader {
-
- /**
- * The array of actions registered with WordPress.
- *
- * @since 1.0.0
- * @access protected
- * @var array $actions The actions registered with WordPress to fire when the plugin loads.
- */
- protected $actions;
-
- /**
- * The array of filters registered with WordPress.
- *
- * @since 1.0.0
- * @access protected
- * @var array $filters The filters registered with WordPress to fire when the plugin loads.
- */
- protected $filters;
-
- /**
- * Initialize the collections used to maintain the actions and filters.
- *
- * @since 1.0.0
- */
- public function __construct() {
-
- $this->actions = array();
- $this->filters = array();
-
- }
-
- /**
- * Add a new action to the collection to be registered with WordPress.
- *
- * @since 1.0.0
- * @param string $hook The name of the WordPress action that is being registered.
- * @param object $component A reference to the instance of the object on which the action is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1.
- */
- public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
- $this->actions = $this->add( $this->actions, $hook, $component, $callback, $priority, $accepted_args );
- }
-
- /**
- * Add a new filter to the collection to be registered with WordPress.
- *
- * @since 1.0.0
- * @param string $hook The name of the WordPress filter that is being registered.
- * @param object $component A reference to the instance of the object on which the filter is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority Optional. The priority at which the function should be fired. Default is 10.
- * @param int $accepted_args Optional. The number of arguments that should be passed to the $callback. Default is 1
- */
- public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
- $this->filters = $this->add( $this->filters, $hook, $component, $callback, $priority, $accepted_args );
- }
-
- /**
- * A utility function that is used to register the actions and hooks into a single
- * collection.
- *
- * @since 1.0.0
- * @access private
- * @param array $hooks The collection of hooks that is being registered (that is, actions or filters).
- * @param string $hook The name of the WordPress filter that is being registered.
- * @param object $component A reference to the instance of the object on which the filter is defined.
- * @param string $callback The name of the function definition on the $component.
- * @param int $priority The priority at which the function should be fired.
- * @param int $accepted_args The number of arguments that should be passed to the $callback.
- * @return array The collection of actions and filters registered with WordPress.
- */
- private function add( $hooks, $hook, $component, $callback, $priority, $accepted_args ) {
-
- $hooks[] = array(
- 'hook' => $hook,
- 'component' => $component,
- 'callback' => $callback,
- 'priority' => $priority,
- 'accepted_args' => $accepted_args
- );
-
- return $hooks;
-
- }
-
- /**
- * Register the filters and actions with WordPress.
- *
- * @since 1.0.0
- */
- public function run() {
-
- foreach ( $this->filters as $hook ) {
- add_filter( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
- }
-
- foreach ( $this->actions as $hook ) {
- add_action( $hook['hook'], array( $hook['component'], $hook['callback'] ), $hook['priority'], $hook['accepted_args'] );
- }
-
- }
-
-}
diff --git a/includes/class-wpfaevent.php b/includes/class-wpfaevent.php
deleted file mode 100644
index 2caa521..0000000
--- a/includes/class-wpfaevent.php
+++ /dev/null
@@ -1,218 +0,0 @@
-
- */
-class Wpfaevent {
-
- /**
- * The loader that's responsible for maintaining and registering all hooks that power
- * the plugin.
- *
- * @since 1.0.0
- * @access protected
- * @var Wpfaevent_Loader $loader Maintains and registers all hooks for the plugin.
- */
- protected $loader;
-
- /**
- * The unique identifier of this plugin.
- *
- * @since 1.0.0
- * @access protected
- * @var string $plugin_name The string used to uniquely identify this plugin.
- */
- protected $plugin_name;
-
- /**
- * The current version of the plugin.
- *
- * @since 1.0.0
- * @access protected
- * @var string $version The current version of the plugin.
- */
- protected $version;
-
- /**
- * Define the core functionality of the plugin.
- *
- * Set the plugin name and the plugin version that can be used throughout the plugin.
- * Load the dependencies, define the locale, and set the hooks for the admin area and
- * the public-facing side of the site.
- *
- * @since 1.0.0
- */
- public function __construct() {
- if ( defined( 'WPFAEVENT_VERSION' ) ) {
- $this->version = WPFAEVENT_VERSION;
- } else {
- $this->version = '1.0.0';
- }
- $this->plugin_name = 'wpfaevent';
-
- $this->load_dependencies();
- $this->set_locale();
- $this->define_admin_hooks();
- $this->define_public_hooks();
-
- }
-
- /**
- * Load the required dependencies for this plugin.
- *
- * Include the following files that make up the plugin:
- *
- * - Wpfaevent_Loader. Orchestrates the hooks of the plugin.
- * - Wpfaevent_i18n. Defines internationalization functionality.
- * - Wpfaevent_Admin. Defines all hooks for the admin area.
- * - Wpfaevent_Public. Defines all hooks for the public side of the site.
- *
- * Create an instance of the loader which will be used to register the hooks
- * with WordPress.
- *
- * @since 1.0.0
- * @access private
- */
- private function load_dependencies() {
-
- /**
- * The class responsible for orchestrating the actions and filters of the
- * core plugin.
- */
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wpfaevent-loader.php';
-
- /**
- * The class responsible for defining internationalization functionality
- * of the plugin.
- */
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wpfaevent-i18n.php';
-
- /**
- * The class responsible for defining all actions that occur in the admin area.
- */
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wpfaevent-admin.php';
-
- /**
- * The class responsible for defining all actions that occur in the public-facing
- * side of the site.
- */
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wpfaevent-public.php';
-
- $this->loader = new Wpfaevent_Loader();
-
- }
-
- /**
- * Define the locale for this plugin for internationalization.
- *
- * Uses the Wpfaevent_i18n class in order to set the domain and to register the hook
- * with WordPress.
- *
- * @since 1.0.0
- * @access private
- */
- private function set_locale() {
-
- $plugin_i18n = new Wpfaevent_i18n();
-
- $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
-
- }
-
- /**
- * Register all of the hooks related to the admin area functionality
- * of the plugin.
- *
- * @since 1.0.0
- * @access private
- */
- private function define_admin_hooks() {
-
- $plugin_admin = new Wpfaevent_Admin( $this->get_plugin_name(), $this->get_version() );
-
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
- $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
-
- }
-
- /**
- * Register all of the hooks related to the public-facing functionality
- * of the plugin.
- *
- * @since 1.0.0
- * @access private
- */
- private function define_public_hooks() {
-
- $plugin_public = new Wpfaevent_Public( $this->get_plugin_name(), $this->get_version() );
-
- $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
- $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
-
- }
-
- /**
- * Run the loader to execute all of the hooks with WordPress.
- *
- * @since 1.0.0
- */
- public function run() {
- $this->loader->run();
- }
-
- /**
- * The name of the plugin used to uniquely identify it within the context of
- * WordPress and to define internationalization functionality.
- *
- * @since 1.0.0
- * @return string The name of the plugin.
- */
- public function get_plugin_name() {
- return $this->plugin_name;
- }
-
- /**
- * The reference to the class that orchestrates the hooks with the plugin.
- *
- * @since 1.0.0
- * @return Wpfaevent_Loader Orchestrates the hooks of the plugin.
- */
- public function get_loader() {
- return $this->loader;
- }
-
- /**
- * Retrieve the version number of the plugin.
- *
- * @since 1.0.0
- * @return string The version number of the plugin.
- */
- public function get_version() {
- return $this->version;
- }
-
-}
diff --git a/includes/index.php b/includes/index.php
deleted file mode 100644
index e71af0e..0000000
--- a/includes/index.php
+++ /dev/null
@@ -1 +0,0 @@
-
-
- WordPress Coding Standards for WPFA Event.
-
-
-
-
-
-
-
-
-
- ./
-
- vendor/*
- node_modules/*
-
-
diff --git a/public/class-wpfa-admin.php b/public/class-wpfa-admin.php
new file mode 100644
index 0000000..1fa57b0
--- /dev/null
+++ b/public/class-wpfa-admin.php
@@ -0,0 +1,99 @@
+id ) {
+ return;
+ }
+
+ $screen->add_help_tab(
+ [
+ 'id' => 'wpfa_overview_help_tab',
+ 'title' => __( 'Overview', 'wpfa-event' ),
+ 'content' => '
' . __( 'This page contains settings for the FOSSASIA Event Plugin. You can configure default image paths and other options.', 'wpfa-event' ) . '
',
+ ]
+ );
+ }
+}
\ No newline at end of file
diff --git a/public/class-wpfa-public.php b/public/class-wpfa-public.php
new file mode 100644
index 0000000..38eba77
--- /dev/null
+++ b/public/class-wpfa-public.php
@@ -0,0 +1,79 @@
+ -1,
+ ], $atts, 'wpfa_speakers' );
+
+ $query = new WP_Query( [
+ 'post_type' => 'wpfa_speaker',
+ 'posts_per_page' => intval( $atts['limit'] ),
+ 'no_found_rows' => true,
+ ] );
+
+ if ( ! $query->have_posts() ) {
+ return '
Please go to the Events page and click "Edit Content" on an event card to manage its specific content.
+
You can still manage global site settings below.
+
+
+
+
+
+
+
Data Sync
+
Manage Speakers
+
Manage Schedule
+
About Section
+
Section Visibility
+
Manage Sponsors
+
Site Settings
+
Theme
+
+
+
Custom Sections
+
Manage Navigation
+
+
Code of Conduct
+
+
+
+
+
+
+
+
Import Sample Data
+
Click this button to populate the current event with sample speakers, sponsors, and settings. This will overwrite existing data for this event.
+
+
+
+
+
+
Manage Speakers
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Manage Schedule Table
+
Create or edit the single schedule table for the "Full Schedule" page. Only one table can exist at a time.
+
+
+
+
+
+
+
+
Edit "About" Section Content
+
Use the editor below to change the content of the "About" section on the main summit page. You can use formatting like bold, italics, lists, and links.
+
+
+
+
+
Manage Section Visibility
+
Use these toggles to show or hide the default sections on the event page.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Theme Settings
+
Customize the color palette for this specific event. These settings will override the global defaults.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Edit Code of Conduct
+
Use the editor below to change the content of the Code of Conduct page. This content is global and applies to all events.
+
+
+
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+
+
+
+
+ ×
+
+
+
+
+
+
+
+
Confirmation
+
Are you sure?
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/c_Users_Nishil_Downloads_test38(1)_templates_events-listing-page.php b/templates/c_Users_Nishil_Downloads_test38(1)_templates_events-listing-page.php
new file mode 100644
index 0000000..5c97138
--- /dev/null
+++ b/templates/c_Users_Nishil_Downloads_test38(1)_templates_events-listing-page.php
@@ -0,0 +1,1356 @@
+ ($b['order'] ?? 10);
+ });
+
+ foreach ($sections_to_render as $section) {
+ $section_id = esc_attr($section['id']);
+ $layout = $section['layout'] ?? 'full_width';
+ $section_type = $section['type'] ?? 'content';
+ ?>
+
+
+
+
+
+ 'page',
+ 'posts_per_page' => -1,
+ 'meta_key' => '_event_date',
+ 'orderby' => 'meta_value',
+ 'order' => 'ASC',
+ 'meta_query' => [
+ 'relation' => 'AND',
+ [
+ 'key' => '_wp_page_template',
+ 'value' => 'fossasia-landing-template.php'
+ ],
+ [
+ // This logic finds events where the end date is today or in the future,
+ // OR if there is no end date, where the start date is today or in the future.
+ 'relation' => 'OR',
+ [
+ 'relation' => 'AND',
+ [
+ 'key' => '_event_end_date',
+ 'compare' => 'EXISTS'
+ ],
+ [
+ 'key' => '_event_end_date',
+ 'value' => $today,
+ 'compare' => '>=',
+ 'type' => 'DATE'
+ ]
+ ],
+ [
+ 'key' => '_event_date',
+ 'value' => $today,
+ 'compare' => '>=',
+ 'type' => 'DATE'
+ ]
+ ]
+ ]
+]);
+$calendar_events = [];
+if ($all_events_query->have_posts()) {
+ while ($all_events_query->have_posts()) {
+ $all_events_query->the_post();
+ $event_date = get_post_meta(get_the_ID(), '_event_date', true);
+ $event_end_date = get_post_meta(get_the_ID(), '_event_end_date', true);
+ $event_place = get_post_meta(get_the_ID(), '_event_place', true);
+ $event_time = get_post_meta(get_the_ID(), '_event_time', true);
+ $event_description = get_the_excerpt();
+ $featured_img_url = get_the_post_thumbnail_url(get_the_ID(), 'large') ?: '';
+
+ $calendar_events[] = [
+ 'id' => get_the_ID(),
+ 'name' => get_the_title(),
+ 'date' => $event_date,
+ 'endDate' => $event_end_date,
+ 'place' => $event_place,
+ 'time' => $event_time,
+ 'description' => $event_description,
+ 'permalink' => get_the_permalink(),
+ 'image_url' => $featured_img_url,
+ 'year' => !empty($event_date) ? date('Y', strtotime($event_date)) : null
+ ];
+ }
+}
+
+/**
+ * Fetches and renders latest blog posts from FOSSASIA blog.
+ */
+function render_latest_news() {
+ include_once( ABSPATH . WPINC . '/feed.php' );
+
+ // Get a SimplePie feed object from the specified feed source.
+ $rss = fetch_feed( 'https://blog.fossasia.org/rss/' );
+
+ if ( is_wp_error( $rss ) ) {
+ echo '
Could not fetch news. Please try again later.
';
+ return;
+ }
+
+ // Figure out how many total items there are, but limit it to 5.
+ $maxitems = $rss->get_item_quantity( 5 );
+
+ // Build an array of all the items, starting with element 0 (first element).
+ $rss_items = $rss->get_items( 0, $maxitems );
+
+ if ( $maxitems == 0 ) {
+ echo '
No news items found.
';
+ } else {
+ // Loop through each feed item and display each item as a hyperlink.
+ echo '
+
+
+
+ 'page',
+ 'posts_per_page' => -1,
+ 'meta_key' => '_event_date',
+ 'orderby' => 'meta_value',
+ 'order' => 'ASC',
+ 'meta_query' => [
+ 'relation' => 'AND',
+ [
+ 'key' => '_wp_page_template',
+ 'value' => 'fossasia-landing-template.php'
+ ],
+ [
+ // This logic finds events where the end date is today or in the future,
+ // OR if there is no end date, where the start date is today or in the future.
+ 'relation' => 'OR',
+ [
+ 'relation' => 'AND',
+ [
+ 'key' => '_event_end_date',
+ 'compare' => 'EXISTS'
+ ],
+ [
+ 'key' => '_event_end_date',
+ 'value' => $today,
+ 'compare' => '>=',
+ 'type' => 'DATE'
+ ]
+ ],
+ [
+ 'key' => '_event_date',
+ 'value' => $today,
+ 'compare' => '>=',
+ 'type' => 'DATE'
+ ]
+ ]
+ ]
+]);
+$calendar_events = [];
+if ($all_events_query->have_posts()) {
+ while ($all_events_query->have_posts()) {
+ $all_events_query->the_post();
+ $event_date = get_post_meta(get_the_ID(), '_event_date', true);
+ $event_end_date = get_post_meta(get_the_ID(), '_event_end_date', true);
+ $event_place = get_post_meta(get_the_ID(), '_event_place', true);
+ $event_time = get_post_meta(get_the_ID(), '_event_time', true);
+ $event_description = get_the_excerpt();
+ $featured_img_url = get_the_post_thumbnail_url(get_the_ID(), 'large') ?: '';
+
+ $calendar_events[] = [
+ 'id' => get_the_ID(),
+ 'name' => get_the_title(),
+ 'date' => $event_date,
+ 'endDate' => $event_end_date,
+ 'place' => $event_place,
+ 'time' => $event_time,
+ 'description' => $event_description,
+ 'permalink' => get_the_permalink(),
+ 'image_url' => $featured_img_url,
+ 'year' => !empty($event_date) ? date('Y', strtotime($event_date)) : null
+ ];
+ }
+}
+
+/**
+ * Fetches and renders latest blog posts from FOSSASIA blog.
+ */
+function render_latest_news() {
+ include_once( ABSPATH . WPINC . '/feed.php' );
+
+ // Get a SimplePie feed object from the specified feed source.
+ $rss = fetch_feed( 'https://blog.fossasia.org/rss/' );
+
+ if ( is_wp_error( $rss ) ) {
+ echo '
Could not fetch news. Please try again later.
';
+ return;
+ }
+
+ // Figure out how many total items there are, but limit it to 5.
+ $maxitems = $rss->get_item_quantity( 5 );
+
+ // Build an array of all the items, starting with element 0 (first element).
+ $rss_items = $rss->get_items( 0, $maxitems );
+
+ if ( $maxitems == 0 ) {
+ echo '
No news items found.
';
+ } else {
+ // Loop through each feed item and display each item as a hyperlink.
+ echo '