Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/portfoli...
File: portfolio.php
</span>
[2500] Fix | Delete
</label>
[2501] Fix | Delete
</fieldset>
[2502] Fix | Delete
<input class="bws_default_shortcode" type="hidden" name="default" value="[latest_portfolio_items count=3]" />
[2503] Fix | Delete
<?php
[2504] Fix | Delete
$script = "function prtfl_shortcode_init() {
[2505] Fix | Delete
( function( $ ) {
[2506] Fix | Delete
$( '.mce-reset #prtfl_display_count' ).on( 'change', function() {
[2507] Fix | Delete
var count = $( '.mce-reset #prtfl_display_count' ).val();
[2508] Fix | Delete
var shortcode = '[latest_portfolio_items count=' + count + ']';
[2509] Fix | Delete
$( '.mce-reset #bws_shortcode_display' ).text( shortcode );
[2510] Fix | Delete
} );
[2511] Fix | Delete
} )( jQuery );
[2512] Fix | Delete
}";
[2513] Fix | Delete
wp_register_script( 'prtfl_display_script', '' );
[2514] Fix | Delete
wp_enqueue_script( 'prtfl_display_script' );
[2515] Fix | Delete
wp_add_inline_script( 'prtfl_display_script', sprintf( $script ) );
[2516] Fix | Delete
?>
[2517] Fix | Delete
<div class="clear"></div>
[2518] Fix | Delete
</div>
[2519] Fix | Delete
<?php
[2520] Fix | Delete
}
[2521] Fix | Delete
}
[2522] Fix | Delete
[2523] Fix | Delete
if ( ! function_exists( 'prtfl_get_data' ) ) {
[2524] Fix | Delete
/**
[2525] Fix | Delete
* Get data for portfolio by ID
[2526] Fix | Delete
*
[2527] Fix | Delete
* @param int $prtfl_id Portfolio ID.
[2528] Fix | Delete
*/
[2529] Fix | Delete
function prtfl_get_data( $prtfl_id ) {
[2530] Fix | Delete
[2531] Fix | Delete
$post_type = array( 'bws-portfolio' );
[2532] Fix | Delete
$prtfl_posts = array();
[2533] Fix | Delete
$prtfl_images_all = array();
[2534] Fix | Delete
[2535] Fix | Delete
if ( 'all' === $prtfl_id || is_array( $prtfl_id ) ) {
[2536] Fix | Delete
[2537] Fix | Delete
$prtfl_id_list = ( is_array( $prtfl_id ) && ! empty( $prtfl_id ) ) ? $prtfl_id : array();
[2538] Fix | Delete
$args = ( is_array( $prtfl_id ) ) ? array(
[2539] Fix | Delete
'post_type' => 'bws-portfolio',
[2540] Fix | Delete
'include' => $prtfl_id_list,
[2541] Fix | Delete
) : array( 'post_type' => 'bws-portfolio' );
[2542] Fix | Delete
$prtfl_posts = get_posts( $args );
[2543] Fix | Delete
[2544] Fix | Delete
} elseif ( is_int( $prtfl_id ) || is_string( $prtfl_id ) ) {
[2545] Fix | Delete
[2546] Fix | Delete
$prtfl_int_id = is_int( $prtfl_id ) ? $prtfl_id : intval( $prtfl_id );
[2547] Fix | Delete
$prtfl_posts = get_post( $prtfl_int_id );
[2548] Fix | Delete
[2549] Fix | Delete
}
[2550] Fix | Delete
[2551] Fix | Delete
$prtfl_posts_end = array();
[2552] Fix | Delete
foreach ( (array) $prtfl_posts as $key => $prtfl_post ) {
[2553] Fix | Delete
[2554] Fix | Delete
$prtfl_meta = get_post_meta( $prtfl_post->ID, '' );
[2555] Fix | Delete
unset( $prtfl_meta['_edit_lock'] );
[2556] Fix | Delete
unset( $prtfl_meta['_edit_last'] );
[2557] Fix | Delete
[2558] Fix | Delete
foreach ( $prtfl_meta['prtfl_information'] as $key => $prtfl_information ) {
[2559] Fix | Delete
$prtfl_information = isset( $prtfl_information ) ? unserialize( $prtfl_information ) : '';
[2560] Fix | Delete
$prtfl_meta['prtfl_information'][ $key ] = $prtfl_information;
[2561] Fix | Delete
}
[2562] Fix | Delete
[2563] Fix | Delete
foreach ( $prtfl_meta['_prtfl_images'] as $key => $prtfl_images ) {
[2564] Fix | Delete
$prtfl_images_all = isset( $prtfl_images ) ? explode( ',', $prtfl_images ) : '';
[2565] Fix | Delete
$args = array(
[2566] Fix | Delete
'post_type' => 'attachment',
[2567] Fix | Delete
'include' => $prtfl_images_all,
[2568] Fix | Delete
);
[2569] Fix | Delete
$prtfl_images = ! empty( $prtfl_images_all ) ? get_posts( $args ) : '';
[2570] Fix | Delete
$prtfl_meta['_prtfl_images'][ $key ] = $prtfl_images;
[2571] Fix | Delete
}
[2572] Fix | Delete
[2573] Fix | Delete
$prtfl_posts[ $key ]->prtfl_post_meta = $prtfl_meta;
[2574] Fix | Delete
}
[2575] Fix | Delete
[2576] Fix | Delete
return $prtfl_posts;
[2577] Fix | Delete
}
[2578] Fix | Delete
}
[2579] Fix | Delete
[2580] Fix | Delete
if ( ! function_exists( 'prtfl_add_tabs' ) ) {
[2581] Fix | Delete
/**
[2582] Fix | Delete
* Add help tab
[2583] Fix | Delete
*/
[2584] Fix | Delete
function prtfl_add_tabs() {
[2585] Fix | Delete
global $prtfl_options;
[2586] Fix | Delete
$screen = get_current_screen();
[2587] Fix | Delete
if ( ( ! empty( $screen->post_type ) && $prtfl_options['post_type_name'] === $screen->post_type ) ||
[2588] Fix | Delete
( ! empty( $screen->taxonomy ) && 'portfolio_executor_profile' === $screen->taxonomy ) ||
[2589] Fix | Delete
( ! empty( $screen->taxonomy ) && 'portfolio_technologies' === $screen->taxonomy ) ||
[2590] Fix | Delete
( isset( $_GET['page'] ) && 'portfolio.php' === $_GET['page'] ) ) {
[2591] Fix | Delete
$args = array(
[2592] Fix | Delete
'id' => 'prtfl',
[2593] Fix | Delete
'section' => '200538929',
[2594] Fix | Delete
);
[2595] Fix | Delete
bws_help_tab( $screen, $args );
[2596] Fix | Delete
}
[2597] Fix | Delete
}
[2598] Fix | Delete
}
[2599] Fix | Delete
[2600] Fix | Delete
if ( ! function_exists( 'prtfl_plugin_deactivation' ) ) {
[2601] Fix | Delete
/**
[2602] Fix | Delete
* Action when deactivating the plugin
[2603] Fix | Delete
*/
[2604] Fix | Delete
function prtfl_plugin_deactivation() {
[2605] Fix | Delete
global $wpdb, $prtfl_bws_demo_data;
[2606] Fix | Delete
[2607] Fix | Delete
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
[2608] Fix | Delete
$old_blog = $wpdb->blogid;
[2609] Fix | Delete
/* Get all blog ids */
[2610] Fix | Delete
$blogids = $wpdb->get_col( "SELECT `blog_id` FROM $wpdb->blogs" );
[2611] Fix | Delete
foreach ( $blogids as $blog_id ) {
[2612] Fix | Delete
switch_to_blog( $blog_id );
[2613] Fix | Delete
prtfl_include_demo_data();
[2614] Fix | Delete
$prtfl_bws_demo_data->bws_remove_demo_data();
[2615] Fix | Delete
}
[2616] Fix | Delete
switch_to_blog( $old_blog );
[2617] Fix | Delete
} else {
[2618] Fix | Delete
global $prtfl_bws_demo_data;
[2619] Fix | Delete
[2620] Fix | Delete
if ( ! $prtfl_bws_demo_data ) {
[2621] Fix | Delete
prtfl_include_demo_data();
[2622] Fix | Delete
}
[2623] Fix | Delete
$prtfl_bws_demo_data->bws_remove_demo_data();
[2624] Fix | Delete
}
[2625] Fix | Delete
}
[2626] Fix | Delete
}
[2627] Fix | Delete
[2628] Fix | Delete
if ( ! function_exists( 'prtfl_plugin_uninstall' ) ) {
[2629] Fix | Delete
/**
[2630] Fix | Delete
* Action when uninstalling the plugin
[2631] Fix | Delete
*/
[2632] Fix | Delete
function prtfl_plugin_uninstall() {
[2633] Fix | Delete
global $wpdb;
[2634] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[2635] Fix | Delete
[2636] Fix | Delete
$plugins_list = get_plugins();
[2637] Fix | Delete
[2638] Fix | Delete
if ( function_exists( 'is_multisite' ) && is_multisite() ) {
[2639] Fix | Delete
$old_blog = $wpdb->blogid;
[2640] Fix | Delete
/* Get all blog ids */
[2641] Fix | Delete
$blogids = $wpdb->get_col( "SELECT `blog_id` FROM $wpdb->blogs" );
[2642] Fix | Delete
foreach ( $blogids as $blog_id ) {
[2643] Fix | Delete
switch_to_blog( $blog_id );
[2644] Fix | Delete
if ( ! array_key_exists( 'portfolio-pro/portfolio-pro.php', $plugins_list ) ) {
[2645] Fix | Delete
delete_option( 'widget_portfolio_technologies_widget' );
[2646] Fix | Delete
delete_option( 'prtfl_options' );
[2647] Fix | Delete
delete_option( 'prtfl_tag_update' );
[2648] Fix | Delete
delete_post_meta_by_key( 'prtfl_information' );
[2649] Fix | Delete
delete_post_meta_by_key( '_prtfl_images' );
[2650] Fix | Delete
delete_post_meta_by_key( 'prtfl_featured' );
[2651] Fix | Delete
}
[2652] Fix | Delete
}
[2653] Fix | Delete
switch_to_blog( $old_blog );
[2654] Fix | Delete
} else {
[2655] Fix | Delete
if ( ! array_key_exists( 'portfolio-pro/portfolio-pro.php', $plugins_list ) ) {
[2656] Fix | Delete
delete_option( 'widget_portfolio_technologies_widget' );
[2657] Fix | Delete
delete_option( 'prtfl_options' );
[2658] Fix | Delete
delete_option( 'prtfl_tag_update' );
[2659] Fix | Delete
delete_post_meta_by_key( 'prtfl_information' );
[2660] Fix | Delete
delete_post_meta_by_key( '_prtfl_images' );
[2661] Fix | Delete
delete_post_meta_by_key( 'prtfl_featured' );
[2662] Fix | Delete
}
[2663] Fix | Delete
}
[2664] Fix | Delete
[2665] Fix | Delete
require_once dirname( __FILE__ ) . '/bws_menu/bws_include.php';
[2666] Fix | Delete
bws_include_init( plugin_basename( __FILE__ ) );
[2667] Fix | Delete
bws_delete_plugin( plugin_basename( __FILE__ ) );
[2668] Fix | Delete
}
[2669] Fix | Delete
}
[2670] Fix | Delete
[2671] Fix | Delete
/* Activate plugin */
[2672] Fix | Delete
register_activation_hook( __FILE__, 'prtfl_plugin_activate' );
[2673] Fix | Delete
/* Add portfolio settings page in admin menu */
[2674] Fix | Delete
add_action( 'admin_menu', 'add_prtfl_admin_menu' );
[2675] Fix | Delete
add_action( 'admin_init', 'prtfl_admin_init' );
[2676] Fix | Delete
add_action( 'init', 'prtfl_init' );
[2677] Fix | Delete
add_action( 'plugins_loaded', 'prtfl_plugins_loaded' );
[2678] Fix | Delete
/* Save custom data from admin */
[2679] Fix | Delete
add_action( 'save_post', 'prtfl_save_postdata', 1, 2 );
[2680] Fix | Delete
add_filter( 'content_save_pre', 'prtfl_content_save_pre', 10, 1 );
[2681] Fix | Delete
[2682] Fix | Delete
/* this function add custom fields and images for PDF&Print plugin in Portfolio post */
[2683] Fix | Delete
add_filter( 'bwsplgns_get_pdf_print_content', 'prtfl_add_pdf_print_content' );
[2684] Fix | Delete
[2685] Fix | Delete
add_action( 'admin_enqueue_scripts', 'prtfl_admin_head' );
[2686] Fix | Delete
add_action( 'wp_enqueue_scripts', 'prtfl_wp_enqueue_scripts' );
[2687] Fix | Delete
add_action( 'wp_head', 'prtfl_wp_head' );
[2688] Fix | Delete
add_action( 'wp_footer', 'prtfl_wp_footer' );
[2689] Fix | Delete
[2690] Fix | Delete
/* add theme name as class to body tag */
[2691] Fix | Delete
add_filter( 'body_class', 'prtfl_theme_body_classes' );
[2692] Fix | Delete
[2693] Fix | Delete
/* Add widget for portfolio technologies */
[2694] Fix | Delete
add_action( 'widgets_init', 'prtfl_register_widget' );
[2695] Fix | Delete
[2696] Fix | Delete
add_action( 'wp_ajax_prtfl_update_image', 'prtfl_update_image' );
[2697] Fix | Delete
[2698] Fix | Delete
add_shortcode( 'latest_portfolio_items', 'prtfl_latest_items' );
[2699] Fix | Delete
/* custom filter for bws button in tinyMCE */
[2700] Fix | Delete
add_filter( 'bws_shortcode_button_content', 'prtfl_shortcode_button_content' );
[2701] Fix | Delete
[2702] Fix | Delete
add_filter( 'request', 'prtfl_request_filter' );
[2703] Fix | Delete
/* Display tachnologies taxonomy */
[2704] Fix | Delete
add_filter( 'pre_get_posts', 'prtfl_technologies_get_posts' );
[2705] Fix | Delete
add_filter( 'rewrite_rules_array', 'prtfl_custom_permalinks' );
[2706] Fix | Delete
/* Additional links on the plugin page */
[2707] Fix | Delete
add_filter( 'plugin_row_meta', 'prtfl_register_plugin_links', 10, 2 );
[2708] Fix | Delete
add_filter( 'plugin_action_links', 'prtfl_plugin_action_links', 10, 2 );
[2709] Fix | Delete
[2710] Fix | Delete
add_filter( 'nav_menu_css_class', 'prtfl_add_portfolio_ancestor_to_menu', 10, 2 );
[2711] Fix | Delete
[2712] Fix | Delete
add_action( 'admin_notices', 'prtfl_admin_notices' );
[2713] Fix | Delete
[2714] Fix | Delete
register_deactivation_hook( __FILE__, 'prtfl_plugin_deactivation' ); /* Deactivate plugin */
[2715] Fix | Delete
[2716] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function