$57 GRAYBYTE WORDPRESS FILE MANAGER $46

SERVER : premium134.web-hosting.com #1 SMP Thu Mar 13 14:29:12 UTC 2025
SERVER IP : 162.0.232.104 | ADMIN IP 216.73.216.80
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/home/raydofqv/techfabasia.com/wp-content/plugins/mas-static-content/

HOME
Current File : /home/raydofqv/techfabasia.com/wp-content/plugins/mas-static-content//mas-static-content.php
<?php
/**
 * Plugin Name:       MAS Static Content
 * Plugin URI:        https://github.com/madrasthemes/mas-static-content
 * Description:       This plugin helps to create a custom post type static content and use it with shortcode.
 * Version:           1.1.2
 * Requires at least: 6.7
 * Requires PHP:      7.4
 * Author:            MadrasThemes
 * Author URI:        https://madrasthemes.com/
 * License:           GPL v3 or later
 * License URI:       https://www.gnu.org/licenses/gpl-3.0.html
 * Text Domain:       mas-static-content
 * Domain Path:       /languages
 *
 * @package Core
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

// Define MAS_STATIC_CONTENT_PLUGIN_FILE.
if ( ! defined( 'MAS_STATIC_CONTENT_PLUGIN_FILE' ) ) {
	define( 'MAS_STATIC_CONTENT_PLUGIN_FILE', __FILE__ );
}

// Include the main Mas_Static_Content class.
if ( ! class_exists( 'Mas_Static_Content' ) ) {
	include_once dirname( MAS_STATIC_CONTENT_PLUGIN_FILE ) . '/includes/class-mas-static-content.php';
}

/**
 * Register the dynamic block type and render callback.
 */
add_action( 'init', function() {
    register_block_type( 'mas-static-content/navigation-static-content', array(
        'render_callback' => 'mas_static_content_render_megamenu_block',
        'attributes'      => array(
            'staticContentId' => array( 'type' => 'integer' ),
        ),
        'supports'        => array(
            'inserter' => true,
        ),
        'parent' => array('core/navigation', 'core/navigation-submenu'),
    ) );
});


/**
 * Render callback for the MegaMenu block.
 *
 * @param array $attributes Block attributes from JS.
 * @return string Rendered HTML content.
 */
function mas_static_content_render_megamenu_block( $attributes ) {


    if ( empty( $attributes['staticContentId'] ) ) {
        return '';
    }

    $post = get_post( $attributes['staticContentId'] );

    if ( ! $post ) {
        return '';
    }

    // Return the content with filters (so shortcodes, blocks, etc. render properly)
    return apply_filters( 'the_content', $post->post_content );
}


add_action( 'enqueue_block_editor_assets', function() {
    wp_enqueue_script(
        'mas_static_content-megamenu-block',
       	plugin_dir_url( MAS_STATIC_CONTENT_PLUGIN_FILE ) . 'build/index.js',
        [ 'wp-blocks', 'wp-element', 'wp-components', 'wp-data', 'wp-editor' ],
        filemtime( dirname( MAS_STATIC_CONTENT_PLUGIN_FILE ) . '/build/index.js' ),
        true
    );
});


/**
 * Unique access instance for Mas_Static_Content class
 */
function mas_static_content() {
	return Mas_Static_Content::instance();
}

// Global for backwards compatibility.
$GLOBALS['mas_static_content'] = mas_static_content();

Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
2 May 2026 9.32 AM
raydofqv / raydofqv
0755
build
--
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0755
includes
--
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0755
languages
--
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0755
src
--
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0755
.htaccess
0.124 KB
29 Apr 2026 5.43 AM
raydofqv / raydofqv
0444
license.txt
34.325 KB
1 Apr 2019 3.45 PM
raydofqv / raydofqv
0644
mas-static-content.php
2.663 KB
3 Nov 2025 3.36 PM
raydofqv / raydofqv
0644
readme.txt
3.303 KB
3 Nov 2025 3.36 PM
raydofqv / raydofqv
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF