Download Maag - Modern Blog & Magazine WordPress Theme Nulled Free ThemeForest 53606198
While demo content looks as close to our demos as possible, there’re a few site-specific settings, that need manual configuration for your convenience, for example, links to your social accounts, widgets and some others.
How to Null Maag - Modern Blog & Magazine WordPress Theme
Edit the file: core/theme-dashboard/class-theme-activation.phpReplace the content with
PHP:
PHP:
<?php
/**
* Theme Activation.
**
@package Maag
*/
if ( ! class_exists( 'CSCO_Theme_Activation' ) ) {
/**
* This class to activate your theme and open up new opportunities.
*/
class CSCO_Theme_Activation {
/**
* Constructor.
*/
public function __construct() {
$this->init();
/** Initialize actions */
add_action( 'csco_theme_dashboard_tabs', array( $this,
'register_settings' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
}
/**
* Initialization
*/
public function init() {
// Set current theme slug.
$this->theme = get_template();
// Set current theme name.
$this->theme_name = $this->get_theme_data( 'Name' );
// Set server url.
$this->server = $this->get_theme_data( 'AuthorURI' );
// Set current domain.
$this->domain = $this->format_domain( home_url() );
// Automatically mark the theme as activated.
update_option( $this->setting_license_data(), array(
'status' => 'active',
'supported_until' => '2099-12-31',
'license_history' => array(
array(
'domain' => $this->domain,
'status' => 'active',
),
),
'purchase_count' => 1,
'item_id' => 'dev',
) );
}
/**
* Format the domain according to certain rules.
**
@param string $string The name of domain.
*/
public function format_domain( $string ) {
$string = rtrim( $string, '/' );
// Remove 'WWW' from URL inside a string.
$string = str_replace( 'www.', '', $string );
return $string;
}
/**
* Get data about the theme.
**
@param mixed $name The name of param.
*/
public function get_theme_data( $name ) {
$data = wp_get_theme( $this->theme );
return $data->get( $name );
}
/**
* Get option name with license data.
*/
public function setting_license_data() {
return sprintf( '%s_license_data', $this->theme );
}
/**
* Add settings to dashboard
**
@param array $tabs The tabs.
*/
public function register_settings( $tabs ) {
$tabs[] = array(
'slug' => 'license',
'label' => esc_html__( 'License Information', 'maag' ),
'priority' => 10,
'content' => $this->render_settings(),
);
return $tabs;
}
/**
* Render settings
*/
public function render_settings() {
ob_start();
wp_verify_nonce( null );
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( esc_html__( 'You do not have sufficient rights to view this
page.', 'maag' ) );
}
// Get current status.
$status = csco_get_license_data( 'status' );
?>
<div class="cs-activation">
<div class="cs-activation-postbox">
<h2 class="hndle"><span><?php esc_html_e( 'License',
'maag' ); ?></span></h2>
<div class="inside">
<?php if ( $status ) { ?>
<p><?php esc_html_e( 'Your theme is
already activated.', 'maag' ); ?></p>
<?php } ?>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
/**
* Enqunue Scripts
**
@param string $page Current page.
*/
public function enqueue_scripts( $page ) {
wp_enqueue_script( 'jquery' );
}
}
/**
* Get data of license.
**
@param string $param The name param.
*/
function csco_get_license_data( $param ) {
$data = get_option( sprintf( '%s_license_data', get_template() ), array() );
if ( is_array( $data ) && isset( $data[ $param ] ) ) {
return $data[ $param ];
}
}
new CSCO_Theme_Activation();
}