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
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/portfoli...
File: portfolio.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
Plugin Name: Portfolio by BestWebSoft
[2] Fix | Delete
Plugin URI: https://bestwebsoft.com/products/wordpress/plugins/portfolio/
[3] Fix | Delete
Description: Create your personal portfolio WordPress website. Manage and showcase past projects to get more clients.
[4] Fix | Delete
Author: BestWebSoft
[5] Fix | Delete
Text Domain: portfolio
[6] Fix | Delete
Domain Path: /languages
[7] Fix | Delete
Version: 2.57
[8] Fix | Delete
Author URI: https://bestwebsoft.com/
[9] Fix | Delete
License: GPLv2 or later
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
@ Copyright 2021 BestWebSoft ( https://support.bestwebsoft.com )
[14] Fix | Delete
[15] Fix | Delete
This program is free software; you can redistribute it and/or modify
[16] Fix | Delete
it under the terms of the GNU General Public License, version 2, as
[17] Fix | Delete
published by the Free Software Foundation.
[18] Fix | Delete
[19] Fix | Delete
This program is distributed in the hope that it will be useful,
[20] Fix | Delete
but WITHOUT ANY WARRANTY; without even the implied warranty of
[21] Fix | Delete
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
[22] Fix | Delete
GNU General Public License for more details.
[23] Fix | Delete
[24] Fix | Delete
You should have received a copy of the GNU General Public License
[25] Fix | Delete
along with this program; if not, write to the Free Software
[26] Fix | Delete
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
[27] Fix | Delete
*/
[28] Fix | Delete
[29] Fix | Delete
if ( ! function_exists( 'add_prtfl_admin_menu' ) ) {
[30] Fix | Delete
/**
[31] Fix | Delete
* Add 'BWS Plugins' menu at the left side in administer panel
[32] Fix | Delete
*/
[33] Fix | Delete
function add_prtfl_admin_menu() {
[34] Fix | Delete
global $submenu, $prtfl_options, $prtfl_plugin_info, $wp_version;
[35] Fix | Delete
[36] Fix | Delete
if ( empty( $prtfl_options ) ) {
[37] Fix | Delete
register_prtfl_settings();
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
$settings = add_submenu_page( 'edit.php?post_type=' . $prtfl_options['post_type_name'], __( 'Portfolio Settings', 'portfolio' ), __( 'Settings', 'portfolio' ), 'manage_options', 'portfolio.php', 'prtfl_settings_page' );
[41] Fix | Delete
[42] Fix | Delete
add_submenu_page( 'edit.php?post_type=' . $prtfl_options['post_type_name'], 'BWS Panel', 'BWS Panel', 'manage_options', 'prtfl-bws-panel', 'bws_add_menu_render' );
[43] Fix | Delete
[44] Fix | Delete
if ( isset( $submenu[ 'edit.php?post_type=' . $prtfl_options['post_type_name'] ] ) ) {
[45] Fix | Delete
$submenu[ 'edit.php?post_type=' . $prtfl_options['post_type_name'] ][] = array(
[46] Fix | Delete
'<span style="color:#d86463"> ' . __( 'Upgrade to Pro', 'portfolio' ) . '</span>',
[47] Fix | Delete
'manage_options',
[48] Fix | Delete
'https://bestwebsoft.com/products/wordpress/plugins/portfolio/?k=f047e20c92c972c398187a4f70240285&pn=74&v=' . $prtfl_plugin_info['Version'] . '&wp_v=' . $wp_version,
[49] Fix | Delete
);
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
add_action( 'load-' . $settings, 'prtfl_add_tabs' );
[53] Fix | Delete
add_action( 'load-post-new.php', 'prtfl_add_tabs' );
[54] Fix | Delete
add_action( 'load-post.php', 'prtfl_add_tabs' );
[55] Fix | Delete
add_action( 'load-edit.php', 'prtfl_add_tabs' );
[56] Fix | Delete
}
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
if ( ! function_exists( 'prtfl_init' ) ) {
[60] Fix | Delete
/**
[61] Fix | Delete
* Main init function
[62] Fix | Delete
*/
[63] Fix | Delete
function prtfl_init() {
[64] Fix | Delete
global $prtfl_boxes, $prtfl_plugin_info;
[65] Fix | Delete
[66] Fix | Delete
require_once dirname( __FILE__ ) . '/bws_menu/bws_include.php';
[67] Fix | Delete
bws_include_init( plugin_basename( __FILE__ ) );
[68] Fix | Delete
[69] Fix | Delete
if ( ! $prtfl_plugin_info ) {
[70] Fix | Delete
if ( ! function_exists( 'get_plugin_data' ) ) {
[71] Fix | Delete
require_once ABSPATH . 'wp-admin/includes/plugin.php';
[72] Fix | Delete
}
[73] Fix | Delete
$prtfl_plugin_info = get_plugin_data( __FILE__ );
[74] Fix | Delete
}
[75] Fix | Delete
/* Function check if plugin is compatible with current WP version */
[76] Fix | Delete
bws_wp_min_version_check( plugin_basename( __FILE__ ), $prtfl_plugin_info, '4.5' );
[77] Fix | Delete
[78] Fix | Delete
$prtfl_boxes['Portfolio-Info'] = array(
[79] Fix | Delete
array(
[80] Fix | Delete
'name' => '_prtfl_short_descr',
[81] Fix | Delete
'title' => __( 'Short description', 'portfolio' ),
[82] Fix | Delete
'type' => 'text',
[83] Fix | Delete
),
[84] Fix | Delete
array(
[85] Fix | Delete
'name' => '_prtfl_date_compl',
[86] Fix | Delete
'title' => __( 'Date of completion', 'portfolio' ),
[87] Fix | Delete
'type' => 'text',
[88] Fix | Delete
),
[89] Fix | Delete
array(
[90] Fix | Delete
'name' => '_prtfl_link',
[91] Fix | Delete
'title' => __( 'Project, URL', 'portfolio' ),
[92] Fix | Delete
'type' => 'url',
[93] Fix | Delete
),
[94] Fix | Delete
array(
[95] Fix | Delete
'name' => '_prtfl_svn',
[96] Fix | Delete
'title' => __( 'Source Files, URL', 'portfolio' ),
[97] Fix | Delete
'type' => 'url',
[98] Fix | Delete
),
[99] Fix | Delete
);
[100] Fix | Delete
/* Call register settings function */
[101] Fix | Delete
register_prtfl_settings();
[102] Fix | Delete
/* Register post type and taxonomy for portfolio */
[103] Fix | Delete
prtfl_post_type_portfolio();
[104] Fix | Delete
[105] Fix | Delete
if ( ! is_admin() ) {
[106] Fix | Delete
/* add template for gallery pages */
[107] Fix | Delete
add_action( 'template_include', 'prtfl_template_include' );
[108] Fix | Delete
}
[109] Fix | Delete
[110] Fix | Delete
/* Demo data */
[111] Fix | Delete
$demo_options = get_option( 'prtfl_demo_options' );
[112] Fix | Delete
if ( ! empty( $demo_options ) || ( isset( $_GET['page'] ) && 'portfolio.php' === $_GET['page'] ) ) {
[113] Fix | Delete
prtfl_include_demo_data();
[114] Fix | Delete
}
[115] Fix | Delete
}
[116] Fix | Delete
}
[117] Fix | Delete
[118] Fix | Delete
if ( ! function_exists( 'prtfl_admin_init' ) ) {
[119] Fix | Delete
/**
[120] Fix | Delete
* Init for dashboard
[121] Fix | Delete
*/
[122] Fix | Delete
function prtfl_admin_init() {
[123] Fix | Delete
global $bws_plugin_info, $prtfl_plugin_info, $bws_shortcode_list, $wpdb, $pagenow, $prtfl_options;
[124] Fix | Delete
[125] Fix | Delete
if ( empty( $bws_plugin_info ) ) {
[126] Fix | Delete
$bws_plugin_info = array(
[127] Fix | Delete
'id' => '74',
[128] Fix | Delete
'version' => $prtfl_plugin_info['Version'],
[129] Fix | Delete
);
[130] Fix | Delete
}
[131] Fix | Delete
[132] Fix | Delete
/* add Portfolio to global $bws_shortcode_list */
[133] Fix | Delete
$bws_shortcode_list['prtfl'] = array(
[134] Fix | Delete
'name' => 'Portfolio',
[135] Fix | Delete
'js_function' => 'prtfl_shortcode_init',
[136] Fix | Delete
);
[137] Fix | Delete
[138] Fix | Delete
if ( 'plugins.php' === $pagenow ) {
[139] Fix | Delete
/* Install the option defaults */
[140] Fix | Delete
if ( function_exists( 'bws_plugin_banner_go_pro' ) ) {
[141] Fix | Delete
register_prtfl_settings();
[142] Fix | Delete
bws_plugin_banner_go_pro( $prtfl_options, $prtfl_plugin_info, 'prtfl', 'portfolio', '56e6c97d1bca3199fb16cb817793a8f6', '74', 'portfolio' );
[143] Fix | Delete
}
[144] Fix | Delete
}
[145] Fix | Delete
}
[146] Fix | Delete
}
[147] Fix | Delete
[148] Fix | Delete
if ( ! function_exists( 'prtfl_plugins_loaded' ) ) {
[149] Fix | Delete
/**
[150] Fix | Delete
* Load textdomain
[151] Fix | Delete
*/
[152] Fix | Delete
function prtfl_plugins_loaded() {
[153] Fix | Delete
load_plugin_textdomain( 'portfolio', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
[154] Fix | Delete
}
[155] Fix | Delete
}
[156] Fix | Delete
[157] Fix | Delete
if ( ! function_exists( 'prtfl_plugin_activate' ) ) {
[158] Fix | Delete
/**
[159] Fix | Delete
* Creating a default options for showing ads. Starts on plugin activation
[160] Fix | Delete
*/
[161] Fix | Delete
function prtfl_plugin_activate() {
[162] Fix | Delete
if ( is_multisite() ) {
[163] Fix | Delete
switch_to_blog( 1 );
[164] Fix | Delete
register_uninstall_hook( __FILE__, 'prtfl_plugin_uninstall' );
[165] Fix | Delete
restore_current_blog();
[166] Fix | Delete
} else {
[167] Fix | Delete
register_uninstall_hook( __FILE__, 'prtfl_plugin_uninstall' );
[168] Fix | Delete
}
[169] Fix | Delete
}
[170] Fix | Delete
}
[171] Fix | Delete
[172] Fix | Delete
if ( ! function_exists( 'register_prtfl_settings' ) ) {
[173] Fix | Delete
/**
[174] Fix | Delete
* Register settings function
[175] Fix | Delete
*/
[176] Fix | Delete
function register_prtfl_settings() {
[177] Fix | Delete
global $prtfl_options, $prtfl_plugin_info, $wpdb;
[178] Fix | Delete
[179] Fix | Delete
/* Install the option defaults */
[180] Fix | Delete
if ( ! get_option( 'prtfl_options' ) ) {
[181] Fix | Delete
$option_defaults = prtfl_get_options_default();
[182] Fix | Delete
add_option( 'prtfl_options', $option_defaults );
[183] Fix | Delete
}
[184] Fix | Delete
[185] Fix | Delete
/* Get options from the database */
[186] Fix | Delete
$prtfl_options = get_option( 'prtfl_options' );
[187] Fix | Delete
[188] Fix | Delete
/* Array merge incase this version has added new options */
[189] Fix | Delete
if ( ! isset( $prtfl_options['plugin_option_version'] ) || $prtfl_options['plugin_option_version'] !== $prtfl_plugin_info['Version'] ) {
[190] Fix | Delete
[191] Fix | Delete
$wpdb->query( "UPDATE {$wpdb->prefix}posts SET post_type = 'bws-portfolio' WHERE post_type = 'portfolio'" );
[192] Fix | Delete
[193] Fix | Delete
$option_defaults = prtfl_get_options_default();
[194] Fix | Delete
[195] Fix | Delete
if ( ! isset( $prtfl_options['plugin_option_version'] ) || $prtfl_options['plugin_option_version'] < '2.29' ) {
[196] Fix | Delete
$option_defaults['widget_updated'] = 0;
[197] Fix | Delete
}
[198] Fix | Delete
/* Add options 'post_type_name' */
[199] Fix | Delete
if ( ! isset( $prtfl_options['post_type_name'] ) ) {
[200] Fix | Delete
$option_defaults['post_type_name'] = 'bws-portfolio';
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
$prtfl_options = array_merge( $option_defaults, $prtfl_options );
[204] Fix | Delete
$prtfl_options['plugin_option_version'] = $option_defaults['plugin_option_version'];
[205] Fix | Delete
/* show pro features */
[206] Fix | Delete
$prtfl_options['hide_premium_options'] = array();
[207] Fix | Delete
[208] Fix | Delete
update_option( 'prtfl_options', $prtfl_options );
[209] Fix | Delete
}
[210] Fix | Delete
[211] Fix | Delete
if ( function_exists( 'add_image_size' ) ) {
[212] Fix | Delete
if ( 'portfolio-thumb' === $prtfl_options['image_size_album'] ) {
[213] Fix | Delete
add_image_size( 'portfolio-thumb', $prtfl_options['custom_size_px']['portfolio-thumb'][0], $prtfl_options['custom_size_px']['portfolio-thumb'][1], true );
[214] Fix | Delete
}
[215] Fix | Delete
if ( 'portfolio-photo-thumb' === $prtfl_options['image_size_photo'] ) {
[216] Fix | Delete
add_image_size( 'portfolio-photo-thumb', $prtfl_options['custom_size_px']['portfolio-photo-thumb'][0], $prtfl_options['custom_size_px']['portfolio-photo-thumb'][1], true );
[217] Fix | Delete
}
[218] Fix | Delete
}
[219] Fix | Delete
}
[220] Fix | Delete
}
[221] Fix | Delete
[222] Fix | Delete
if ( ! function_exists( 'prtfl_get_options_default' ) ) {
[223] Fix | Delete
/**
[224] Fix | Delete
* Get Plugin default options
[225] Fix | Delete
*/
[226] Fix | Delete
function prtfl_get_options_default() {
[227] Fix | Delete
global $prtfl_plugin_info;
[228] Fix | Delete
[229] Fix | Delete
$option_defaults = array(
[230] Fix | Delete
/* internal general */
[231] Fix | Delete
'plugin_option_version' => $prtfl_plugin_info['Version'],
[232] Fix | Delete
'first_install' => strtotime( 'now' ),
[233] Fix | Delete
'suggest_feature_banner' => 1,
[234] Fix | Delete
'display_settings_notice' => 1,
[235] Fix | Delete
/* internal */
[236] Fix | Delete
'display_demo_notice' => 1,
[237] Fix | Delete
/* settings */
[238] Fix | Delete
'image_size_album' => 'medium',
[239] Fix | Delete
'image_size_photo' => 'thumbnail',
[240] Fix | Delete
'custom_size_px' => array(
[241] Fix | Delete
'portfolio-thumb' => array( 280, 300 ),
[242] Fix | Delete
'portfolio-photo-thumb' => array( 240, 260 ),
[243] Fix | Delete
),
[244] Fix | Delete
'page_id_portfolio_template' => '',
[245] Fix | Delete
'order_by' => 'date',
[246] Fix | Delete
'order' => 'DESC',
[247] Fix | Delete
'custom_image_row_count' => 3,
[248] Fix | Delete
'custom_portfolio_row_count' => 1,
[249] Fix | Delete
'date_additional_field' => 1,
[250] Fix | Delete
'link_additional_field' => 1,
[251] Fix | Delete
'shrdescription_additional_field' => 1,
[252] Fix | Delete
'description_additional_field' => 1,
[253] Fix | Delete
'svn_additional_field' => 1,
[254] Fix | Delete
'svn_additional_field_for_non_logged' => 1,
[255] Fix | Delete
'executor_additional_field' => 1,
[256] Fix | Delete
'technologies_additional_field' => 1,
[257] Fix | Delete
'link_additional_field_for_non_registered' => 1,
[258] Fix | Delete
'date_text_field' => __( 'Date of completion:', 'portfolio' ),
[259] Fix | Delete
'link_text_field' => __( 'Project, URL:', 'portfolio' ),
[260] Fix | Delete
'shrdescription_text_field' => __( 'Short description:', 'portfolio' ),
[261] Fix | Delete
'description_text_field' => __( 'Description:', 'portfolio' ),
[262] Fix | Delete
'svn_text_field' => __( 'Source Files, URL:', 'portfolio' ),
[263] Fix | Delete
'executor_text_field' => __( 'Executor:', 'portfolio' ),
[264] Fix | Delete
'screenshot_text_field' => __( 'More screenshots:', 'portfolio' ),
[265] Fix | Delete
'technologies_text_field' => __( 'Technologies:', 'portfolio' ),
[266] Fix | Delete
/* misc */
[267] Fix | Delete
'slug' => 'portfolio',
[268] Fix | Delete
'post_type_name' => 'bws-portfolio',
[269] Fix | Delete
/* other */
[270] Fix | Delete
'widget_updated' => 1, /* this option is for updating plugin was added in v2.29 */
[271] Fix | Delete
'flush_rewrite_rules' => 1,
[272] Fix | Delete
);
[273] Fix | Delete
return $option_defaults;
[274] Fix | Delete
}
[275] Fix | Delete
}
[276] Fix | Delete
[277] Fix | Delete
if ( ! function_exists( 'prtfl_post_type_portfolio' ) ) {
[278] Fix | Delete
/**
[279] Fix | Delete
* Create post type for portfolio
[280] Fix | Delete
*/
[281] Fix | Delete
function prtfl_post_type_portfolio() {
[282] Fix | Delete
global $wpdb, $prtfl_options;
[283] Fix | Delete
[284] Fix | Delete
register_post_type(
[285] Fix | Delete
$prtfl_options['post_type_name'],
[286] Fix | Delete
array(
[287] Fix | Delete
'labels' => array(
[288] Fix | Delete
'name' => __( 'Portfolio', 'portfolio' ),
[289] Fix | Delete
'all_items' => __( 'Projects', 'portfolio' ),
[290] Fix | Delete
'singular_name' => __( 'Project', 'portfolio' ),
[291] Fix | Delete
'add_new' => __( 'Add New', 'portfolio' ),
[292] Fix | Delete
'add_new_item' => __( 'Add New Project', 'portfolio' ),
[293] Fix | Delete
'edit' => __( 'Edit', 'portfolio' ),
[294] Fix | Delete
'edit_item' => __( 'Edit Project', 'portfolio' ),
[295] Fix | Delete
'new_item' => __( 'New Project', 'portfolio' ),
[296] Fix | Delete
'view' => __( 'View Project', 'portfolio' ),
[297] Fix | Delete
'view_item' => __( 'View Project', 'portfolio' ),
[298] Fix | Delete
'search_items' => __( 'Search Projects', 'portfolio' ),
[299] Fix | Delete
'not_found' => __( 'No project found', 'portfolio' ),
[300] Fix | Delete
'not_found_in_trash' => __( 'No project found in Trash', 'portfolio' ),
[301] Fix | Delete
'parent' => __( 'Parent Project', 'portfolio' ),
[302] Fix | Delete
'filter_items_list' => __( 'Filter projects list', 'portfolio' ),
[303] Fix | Delete
'items_list_navigation' => __( 'Projects list navigation', 'portfolio' ),
[304] Fix | Delete
'items_list' => __( 'Projects list', 'portfolio' ),
[305] Fix | Delete
),
[306] Fix | Delete
'description' => __( 'Create a project item', 'portfolio' ),
[307] Fix | Delete
'public' => true,
[308] Fix | Delete
'show_ui' => true,
[309] Fix | Delete
'publicly_queryable' => true,
[310] Fix | Delete
'exclude_from_search' => true,
[311] Fix | Delete
'hierarchical' => true,
[312] Fix | Delete
'query_var' => true,
[313] Fix | Delete
'register_meta_box_cb' => 'prtfl_init_metaboxes',
[314] Fix | Delete
'rewrite' => array( 'slug' => $prtfl_options['slug'] ),
[315] Fix | Delete
'menu_icon' => 'dashicons-id-alt',
[316] Fix | Delete
'supports' => array(
[317] Fix | Delete
'title', /* Text input field to create a post title. */
[318] Fix | Delete
'editor',
[319] Fix | Delete
'custom-fields',
[320] Fix | Delete
'comments', /* Ability to turn on/off comments. */
[321] Fix | Delete
'thumbnail', /* Displays a box for featured image. */
[322] Fix | Delete
'author',
[323] Fix | Delete
'page-attributes',
[324] Fix | Delete
),
[325] Fix | Delete
)
[326] Fix | Delete
);
[327] Fix | Delete
[328] Fix | Delete
register_taxonomy(
[329] Fix | Delete
'portfolio_executor_profile',
[330] Fix | Delete
$prtfl_options['post_type_name'],
[331] Fix | Delete
array(
[332] Fix | Delete
'hierarchical' => false,
[333] Fix | Delete
'update_count_callback' => '_update_post_term_count',
[334] Fix | Delete
'labels' => array(
[335] Fix | Delete
'name' => __( 'Executors', 'portfolio' ),
[336] Fix | Delete
'singular_name' => __( 'Executor', 'portfolio' ),
[337] Fix | Delete
'search_items' => __( 'Search Executors', 'portfolio' ),
[338] Fix | Delete
'popular_items' => __( 'Popular Executors', 'portfolio' ),
[339] Fix | Delete
'all_items' => __( 'All Executors', 'portfolio' ),
[340] Fix | Delete
'parent_item' => __( 'Parent Executor', 'portfolio' ),
[341] Fix | Delete
'parent_item_colon' => __( 'Parent Executor:', 'portfolio' ),
[342] Fix | Delete
'edit_item' => __( 'Edit Executor', 'portfolio' ),
[343] Fix | Delete
'update_item' => __( 'Update Executor', 'portfolio' ),
[344] Fix | Delete
'add_new_item' => __( 'Add New Executor', 'portfolio' ),
[345] Fix | Delete
'new_item_name' => __( 'New Executor Name', 'portfolio' ),
[346] Fix | Delete
'separate_items_with_commas' => __( 'Separate executors with commas', 'portfolio' ),
[347] Fix | Delete
'add_or_remove_items' => __( 'Add or remove Executor', 'portfolio' ),
[348] Fix | Delete
'choose_from_most_used' => __( 'Choose from the most used Executors', 'portfolio' ),
[349] Fix | Delete
'menu_name' => __( 'Executors', 'portfolio' ),
[350] Fix | Delete
'items_list_navigation' => __( 'Executors list navigation', 'portfolio' ),
[351] Fix | Delete
'items_list' => __( 'Executors list', 'portfolio' ),
[352] Fix | Delete
),
[353] Fix | Delete
'sort' => true,
[354] Fix | Delete
'args' => array( 'orderby' => 'term_order' ),
[355] Fix | Delete
'rewrite' => array( 'slug' => 'executor_profile' ),
[356] Fix | Delete
'show_tagcloud' => false,
[357] Fix | Delete
)
[358] Fix | Delete
);
[359] Fix | Delete
[360] Fix | Delete
register_taxonomy(
[361] Fix | Delete
'portfolio_technologies',
[362] Fix | Delete
$prtfl_options['post_type_name'],
[363] Fix | Delete
array(
[364] Fix | Delete
'hierarchical' => false,
[365] Fix | Delete
'update_count_callback' => '_update_post_term_count',
[366] Fix | Delete
'labels' => array(
[367] Fix | Delete
'name' => __( 'Technologies', 'portfolio' ),
[368] Fix | Delete
'singular_name' => __( 'Technology', 'portfolio' ),
[369] Fix | Delete
'search_items' => __( 'Search Technologies', 'portfolio' ),
[370] Fix | Delete
'popular_items' => __( 'Popular Technologies', 'portfolio' ),
[371] Fix | Delete
'all_items' => __( 'All Technologies', 'portfolio' ),
[372] Fix | Delete
'parent_item' => __( 'Parent Technology', 'portfolio' ),
[373] Fix | Delete
'parent_item_colon' => __( 'Parent Technology:', 'portfolio' ),
[374] Fix | Delete
'edit_item' => __( 'Edit Technology', 'portfolio' ),
[375] Fix | Delete
'update_item' => __( 'Update Technology', 'portfolio' ),
[376] Fix | Delete
'add_new_item' => __( 'Add New Technology', 'portfolio' ),
[377] Fix | Delete
'new_item_name' => __( 'New Technology Name', 'portfolio' ),
[378] Fix | Delete
'separate_items_with_commas' => __( 'Separate technologies with commas', 'portfolio' ),
[379] Fix | Delete
'add_or_remove_items' => __( 'Add or remove Technology', 'portfolio' ),
[380] Fix | Delete
'choose_from_most_used' => __( 'Choose from the most used technologies', 'portfolio' ),
[381] Fix | Delete
'menu_name' => __( 'Technologies', 'portfolio' ),
[382] Fix | Delete
'items_list_navigation' => __( 'Technologies list navigation', 'portfolio' ),
[383] Fix | Delete
'items_list' => __( 'Technologies list', 'portfolio' ),
[384] Fix | Delete
),
[385] Fix | Delete
'query_var' => 'technologies',
[386] Fix | Delete
'rewrite' => array( 'slug' => 'technologies' ),
[387] Fix | Delete
'show_ui' => true,
[388] Fix | Delete
'show_tagcloud' => false,
[389] Fix | Delete
)
[390] Fix | Delete
);
[391] Fix | Delete
[392] Fix | Delete
if ( isset( $prtfl_options['flush_rewrite_rules'] ) && 1 === absint( $prtfl_options['flush_rewrite_rules'] ) ) {
[393] Fix | Delete
flush_rewrite_rules();
[394] Fix | Delete
$prtfl_options['flush_rewrite_rules'] = 0;
[395] Fix | Delete
update_option( 'prtfl_options', $prtfl_options );
[396] Fix | Delete
}
[397] Fix | Delete
}
[398] Fix | Delete
}
[399] Fix | Delete
[400] Fix | Delete
if ( ! function_exists( 'prtfl_include_demo_data' ) ) {
[401] Fix | Delete
/**
[402] Fix | Delete
* Plugin include demo
[403] Fix | Delete
*/
[404] Fix | Delete
function prtfl_include_demo_data() {
[405] Fix | Delete
global $prtfl_bws_demo_data;
[406] Fix | Delete
require_once plugin_dir_path( __FILE__ ) . 'includes/demo-data/class-bws-demo-data.php';
[407] Fix | Delete
$args = array(
[408] Fix | Delete
'plugin_basename' => plugin_basename( __FILE__ ),
[409] Fix | Delete
'plugin_prefix' => 'prtfl_',
[410] Fix | Delete
'plugin_name' => 'Portfolio',
[411] Fix | Delete
'plugin_page' => 'portfolio.php&bws_active_tab=import-export',
[412] Fix | Delete
'demo_folder' => plugin_dir_path( __FILE__ ) . 'includes/demo-data/',
[413] Fix | Delete
);
[414] Fix | Delete
$prtfl_bws_demo_data = new Bws_Demo_Data( $args );
[415] Fix | Delete
[416] Fix | Delete
/* filter for image url from demo data */
[417] Fix | Delete
add_filter( 'wp_get_attachment_url', array( $prtfl_bws_demo_data, 'bws_wp_get_attachment_url' ), 10, 2 );
[418] Fix | Delete
add_filter( 'wp_get_attachment_image_attributes', array( $prtfl_bws_demo_data, 'bws_wp_get_attachment_image_attributes' ), 10, 3 );
[419] Fix | Delete
add_filter( 'wp_update_attachment_metadata', array( $prtfl_bws_demo_data, 'bws_wp_update_attachment_metadata' ), 10, 2 );
[420] Fix | Delete
}
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
if ( ! function_exists( 'prtfl_settings_page' ) ) {
[424] Fix | Delete
/**
[425] Fix | Delete
* Plugin settings page
[426] Fix | Delete
*/
[427] Fix | Delete
function prtfl_settings_page() {
[428] Fix | Delete
if ( ! class_exists( 'Bws_Settings_Tabs' ) ) {
[429] Fix | Delete
require_once dirname( __FILE__ ) . '/bws_menu/class-bws-settings.php';
[430] Fix | Delete
}
[431] Fix | Delete
require_once dirname( __FILE__ ) . '/includes/class-prtfl-settings.php';
[432] Fix | Delete
$page = new Prtfl_Settings_Tabs( plugin_basename( __FILE__ ) );
[433] Fix | Delete
if ( method_exists( $page, 'add_request_feature' ) ) {
[434] Fix | Delete
$page->add_request_feature();
[435] Fix | Delete
} ?>
[436] Fix | Delete
<div class="wrap">
[437] Fix | Delete
<h1><?php esc_html_e( 'Portfolio Settings', 'portfolio' ); ?></h1>
[438] Fix | Delete
<?php $page->display_content(); ?>
[439] Fix | Delete
</div>
[440] Fix | Delete
<?php
[441] Fix | Delete
}
[442] Fix | Delete
}
[443] Fix | Delete
[444] Fix | Delete
if ( ! function_exists( 'prtfl_request_filter' ) ) {
[445] Fix | Delete
/**
[446] Fix | Delete
* Add query_var "post_type" in case we have another custom post type with query_var 'portfolio' (example: jetpack portfolio)
[447] Fix | Delete
*
[448] Fix | Delete
* @param array $query_vars Query vars array.
[449] Fix | Delete
* @return array $query_vars Query vars array.
[450] Fix | Delete
*/
[451] Fix | Delete
function prtfl_request_filter( $query_vars ) {
[452] Fix | Delete
global $prtfl_options;
[453] Fix | Delete
if ( isset( $query_vars['post_type'] ) && 'jetpack-portfolio' === $query_vars['post_type'] ) {
[454] Fix | Delete
if ( ! get_posts( $query_vars ) ) {
[455] Fix | Delete
$query_vars['post_type'] = $prtfl_options['post_type_name'];
[456] Fix | Delete
}
[457] Fix | Delete
}
[458] Fix | Delete
return $query_vars;
[459] Fix | Delete
}
[460] Fix | Delete
}
[461] Fix | Delete
[462] Fix | Delete
if ( ! function_exists( 'prtfl_technologies_get_posts' ) ) {
[463] Fix | Delete
/**
[464] Fix | Delete
* Change post type for portfolio
[465] Fix | Delete
*
[466] Fix | Delete
* @param object $query WP Query object.
[467] Fix | Delete
* @return object $query Changed WP Query object.
[468] Fix | Delete
*/
[469] Fix | Delete
function prtfl_technologies_get_posts( $query ) {
[470] Fix | Delete
global $prtfl_options;
[471] Fix | Delete
[472] Fix | Delete
if ( ( isset( $query->query_vars['technologies'] ) || isset( $query->query_vars['portfolio_executor_profile'] ) ) && ( ! is_admin() ) ) {
[473] Fix | Delete
$query->set( 'post_type', array( $prtfl_options['post_type_name'] ) );
[474] Fix | Delete
}
[475] Fix | Delete
return $query;
[476] Fix | Delete
}
[477] Fix | Delete
}
[478] Fix | Delete
[479] Fix | Delete
if ( ! function_exists( 'prtfl_register_widget' ) ) {
[480] Fix | Delete
/**
[481] Fix | Delete
* Create new widget
[482] Fix | Delete
*/
[483] Fix | Delete
function prtfl_register_widget() {
[484] Fix | Delete
if ( ! class_exists( 'Portfolio_Technologies_Widget' ) ) {
[485] Fix | Delete
require_once dirname( __FILE__ ) . '/includes/class-portfolio-technologies-widget.php';
[486] Fix | Delete
}
[487] Fix | Delete
register_widget( 'Portfolio_Technologies_Widget' );
[488] Fix | Delete
if ( ! class_exists( 'Prtfl_Widget' ) ) {
[489] Fix | Delete
require_once dirname( __FILE__ ) . '/includes/class-prtfl-widget.php';
[490] Fix | Delete
}
[491] Fix | Delete
register_widget( 'Prtfl_Widget' );
[492] Fix | Delete
}
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
if ( ! function_exists( 'prtfl_custom_permalinks' ) ) {
[496] Fix | Delete
/**
[497] Fix | Delete
* Create custom permalinks for portfolio post type
[498] Fix | Delete
*
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function