Files

46 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
/**
* Plugin Name: Falah Souq
* Plugin URI: https://falahos.my
* Description: Islamic marketplace shortcode — [souq_marketplace] renders a Fiverr-style service grid.
* Version: 1.0.0
* Author: FalahOS
* Text Domain: falah-souq
*/
defined( 'ABSPATH' ) || exit;
define( 'FALAH_SOUQ_VERSION', '1.0.0' );
define( 'FALAH_SOUQ_DIR', plugin_dir_path( __FILE__ ) );
define( 'FALAH_SOUQ_URL', plugin_dir_url( __FILE__ ) );
require_once FALAH_SOUQ_DIR . 'includes/post-type.php';
require_once FALAH_SOUQ_DIR . 'includes/shortcode.php';
function falah_souq_enqueue( $hook ) {
if ( is_singular( 'souq_service' ) || has_shortcode( get_post()->post_content ?? '', 'souq_marketplace' ) ) {
wp_enqueue_style(
'falah-souq',
FALAH_SOUQ_URL . 'assets/falah-souq.css',
[],
FALAH_SOUQ_VERSION
);
}
}
add_action( 'wp_enqueue_scripts', 'falah_souq_enqueue' );
function falah_souq_enqueue_always() {
wp_enqueue_style(
'falah-souq',
FALAH_SOUQ_URL . 'assets/falah-souq.css',
[],
FALAH_SOUQ_VERSION
);
}
add_action( 'wp_enqueue_scripts', 'falah_souq_enqueue_always' );
register_activation_hook( __FILE__, function () {
falah_souq_register_post_type();
flush_rewrite_rules();
} );