Uname:Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64

Base Dir : /home/nobi37te/public_html

User : nobi37te


403WebShell
403Webshell
Server IP : 104.21.25.182  /  Your IP : 216.73.217.68
Web Server : Apache
System : Linux server.rehabsharif.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User : nobi37te ( 1003)
PHP Version : 8.2.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/nobi37te/public_html/wp-content/plugins/learndash-certificate-builder/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/nobi37te/public_html/wp-content/plugins/learndash-certificate-builder/src/functions.php
<?php
/**
 * Contains set of helper function.
 *
 * @file
 * @package Learndas_Certificate_Builder
 */

use LearnDash_Certificate_Builder\Controller\Fonts_Manager;

/**
 * Return the plugin asset URL
 *
 * @param string $path relative path to the assets.
 *
 * @return string
 */
function learndash_certificate_builder_asset_url( $path ) {
	$base_url = plugin_dir_url( dirname( __FILE__ ) );

	return untrailingslashit( $base_url ) . $path;
}

/**
 * Return the plugin asset path
 *
 * @param string $path relative path to the assets.
 *
 * @return string
 */
function learndash_certificate_builder_path( $path ) {
	$base_path = plugin_dir_path( dirname( __FILE__ ) );

	return $base_path . $path;
}

/**
 * Activate gutenberg for this post type
 *
 * @param array $args The big array that contains all the CPT define.
 *
 * @return mixed
 */
function learndash_certificate_builder_enable_show_in_rest( $args ) {
	if ( ! function_exists( 'learndash_get_post_type_slug' ) ) {
		return;
	}
	$post_type = learndash_get_post_type_slug( 'certificate' );
	if ( isset( $args[ $post_type ] ) ) {
		$args[ $post_type ]['cpt_options']['show_in_rest'] = true;
	}

	return $args;
}

add_filter( 'learndash_post_args', 'learndash_certificate_builder_enable_show_in_rest' );

// register the Font Manager in Certificates section.
add_action(
	'learndash_settings_pages_init',
	function () {
		Fonts_Manager::add_page_instance();
	}
);

add_action( 'enqueue_block_editor_assets', 'learndash_certificate_builder_enqueue_block_extender' );
/**
 * Enqueue the extender js to apply new functions to ld block. This need to add before the core block queue.
 */
function learndash_certificate_builder_enqueue_block_extender() {
	if ( ! function_exists( 'learndash_get_post_type_slug' ) ) {
		return;
	}
	// only load inside certificate.
	global $current_screen;
	if ( ! is_object( $current_screen ) ) {
		return;
	}

	if ( learndash_get_post_type_slug( 'certificate' ) === $current_screen->id ) {
		wp_enqueue_script(
			'learndash-certificate-builder-extender',
			learndash_certificate_builder_asset_url( '/build/certificate-builder-extender.js' ),
			array(
				'wp-hooks',
				'wp-polyfill',
			),
			time(),
			false
		);
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit