Plugin Directory

Changeset 3425739


Ignore:
Timestamp:
12/23/2025 03:06:18 AM (2 months ago)
Author:
nas9286
Message:

add services and project year

Location:
portfolio-pro-advance
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • portfolio-pro-advance/tags/1.3.1/includes/class-portfolio-meta-display.php

    r3425730 r3425739  
    1818    }
    1919
    20     /**
    21      * Append custom meta fields and project gallery to petruth_portfolio content.
    22      *
    23      * @param string $content Original post content.
    24      * @return string Modified content with meta and gallery appended.
    25      */
    2620    public function append_petruth_meta_to_content($content) {
    2721        if (
     
    5953        $meta_html .= '</div>';
    6054
    61         // === Pro Meta Fields (Unconditional) ===
     55        // === Pro Meta Fields ===
    6256        $pro_meta = '';
    6357       
    64         $client = get_post_meta($post->ID, '_client', true);
    65         $budget = get_post_meta($post->ID, '_budget', true);
    66         $location = get_post_meta($post->ID, '_location', true);
    67         $team = get_post_meta($post->ID, '_team', true);
    68         $timeline = get_post_meta($post->ID, '_timeline', true);
    69         $is_private = get_post_meta($post->ID, '_is_private', true);
     58        $client       = get_post_meta($post->ID, '_client', true);
     59        $services     = get_post_meta($post->ID, '_services', true);     // Added
     60        $project_year = get_post_meta($post->ID, '_project_year', true); // Added
     61        $budget       = get_post_meta($post->ID, '_budget', true);
     62        $location     = get_post_meta($post->ID, '_location', true);
     63        $team         = get_post_meta($post->ID, '_team', true);
     64        $timeline     = get_post_meta($post->ID, '_timeline', true);
     65        $is_private   = get_post_meta($post->ID, '_is_private', true);
    7066
    7167        $pro_meta .= '<div class="petruth-meta-pro-details">';
    7268        if ($client) {
    7369            $pro_meta .= '<p><strong>' . esc_html__('Client:', 'portfolio-pro-advance') . '</strong> ' . esc_html($client) . '</p>';
     70        }
     71        if ($services) {
     72            $pro_meta .= '<p><strong>' . esc_html__('Services:', 'portfolio-pro-advance') . '</strong> ' . esc_html($services) . '</p>';
     73        }
     74        if ($project_year) {
     75            $pro_meta .= '<p><strong>' . esc_html__('Year:', 'portfolio-pro-advance') . '</strong> ' . esc_html($project_year) . '</p>';
    7476        }
    7577        if ($budget) {
     
    8688        }
    8789        if ($is_private === '1') {
    88            
    8990            $pro_meta .= '<p><em>' . esc_html__('This portfolio is private.', 'portfolio-pro-advance') . '</em></p>';
    9091        }
  • portfolio-pro-advance/tags/1.3.1/includes/class-portfolio-pro-post-types.php

    r3425730 r3425739  
    251251
    252252        $client = get_post_meta($post->ID, '_client', true);
     253        $services = get_post_meta($post->ID, '_services', true); // Added
     254        $project_year = get_post_meta($post->ID, '_project_year', true); // Added
    253255        $budget = get_post_meta($post->ID, '_budget', true);
    254256        $location = get_post_meta($post->ID, '_location', true);
     
    260262            <p><label for="client"><?php esc_html_e('Client', 'portfolio-pro-advance'); ?></label>
    261263            <input type="text" id="client" name="client" value="<?php echo esc_attr($client); ?>" class="widefat"></p>
     264           
     265            <p><label for="services"><?php esc_html_e('Services', 'portfolio-pro-advance'); ?></label>
     266            <input type="text" id="services" name="services" value="<?php echo esc_attr($services); ?>" class="widefat"></p>
     267
     268            <p><label for="project_year"><?php esc_html_e('Project Year', 'portfolio-pro-advance'); ?></label>
     269            <input type="text" id="project_year" name="project_year" value="<?php echo esc_attr($project_year); ?>" class="widefat"></p>
     270
    262271            <p><label for="budget"><?php esc_html_e('Budget', 'portfolio-pro-advance'); ?></label>
    263272            <input type="text" id="budget" name="budget" value="<?php echo esc_attr($budget); ?>" class="widefat"></p>
     273           
    264274            <p><label for="location"><?php esc_html_e('Location', 'portfolio-pro-advance'); ?></label>
    265275            <input type="text" id="location" name="location" value="<?php echo esc_attr($location); ?>" class="widefat"></p>
     276           
    266277            <p><label for="team"><?php esc_html_e('Team', 'portfolio-pro-advance'); ?></label>
    267278            <input type="text" id="team" name="team" value="<?php echo esc_attr($team); ?>" class="widefat"></p>
     279           
    268280            <p><label for="timeline"><?php esc_html_e('Timeline', 'portfolio-pro-advance'); ?></label>
    269281            <input type="text" id="timeline" name="timeline" value="<?php echo esc_attr($timeline); ?>" class="widefat"></p>
     282           
    270283            <p><label>
    271284                <input type="checkbox" name="is_private" value="1" <?php checked($is_private, '1'); ?> />
     
    286299        if (!current_user_can('edit_post', $post_id)) return;
    287300
    288         foreach (['client', 'budget', 'location', 'team', 'timeline'] as $field) {
     301        // Added services and project_year to the array below
     302        foreach (['client', 'services', 'project_year', 'budget', 'location', 'team', 'timeline'] as $field) {
    289303            if (isset($_POST[$field])) {
    290304                update_post_meta($post_id, "_$field", sanitize_text_field(wp_unslash($_POST[$field])));
  • portfolio-pro-advance/trunk/includes/class-portfolio-meta-display.php

    r3413540 r3425739  
    1818    }
    1919
    20     /**
    21      * Append custom meta fields and project gallery to petruth_portfolio content.
    22      *
    23      * @param string $content Original post content.
    24      * @return string Modified content with meta and gallery appended.
    25      */
    2620    public function append_petruth_meta_to_content($content) {
    2721        if (
     
    5953        $meta_html .= '</div>';
    6054
    61         // === Pro Meta Fields (Unconditional) ===
     55        // === Pro Meta Fields ===
    6256        $pro_meta = '';
    6357       
    64         $client = get_post_meta($post->ID, '_client', true);
    65         $budget = get_post_meta($post->ID, '_budget', true);
    66         $location = get_post_meta($post->ID, '_location', true);
    67         $team = get_post_meta($post->ID, '_team', true);
    68         $timeline = get_post_meta($post->ID, '_timeline', true);
    69         $is_private = get_post_meta($post->ID, '_is_private', true);
     58        $client       = get_post_meta($post->ID, '_client', true);
     59        $services     = get_post_meta($post->ID, '_services', true);     // Added
     60        $project_year = get_post_meta($post->ID, '_project_year', true); // Added
     61        $budget       = get_post_meta($post->ID, '_budget', true);
     62        $location     = get_post_meta($post->ID, '_location', true);
     63        $team         = get_post_meta($post->ID, '_team', true);
     64        $timeline     = get_post_meta($post->ID, '_timeline', true);
     65        $is_private   = get_post_meta($post->ID, '_is_private', true);
    7066
    7167        $pro_meta .= '<div class="petruth-meta-pro-details">';
    7268        if ($client) {
    7369            $pro_meta .= '<p><strong>' . esc_html__('Client:', 'portfolio-pro-advance') . '</strong> ' . esc_html($client) . '</p>';
     70        }
     71        if ($services) {
     72            $pro_meta .= '<p><strong>' . esc_html__('Services:', 'portfolio-pro-advance') . '</strong> ' . esc_html($services) . '</p>';
     73        }
     74        if ($project_year) {
     75            $pro_meta .= '<p><strong>' . esc_html__('Year:', 'portfolio-pro-advance') . '</strong> ' . esc_html($project_year) . '</p>';
    7476        }
    7577        if ($budget) {
     
    8688        }
    8789        if ($is_private === '1') {
    88            
    8990            $pro_meta .= '<p><em>' . esc_html__('This portfolio is private.', 'portfolio-pro-advance') . '</em></p>';
    9091        }
  • portfolio-pro-advance/trunk/includes/class-portfolio-pro-post-types.php

    r3423645 r3425739  
    251251
    252252        $client = get_post_meta($post->ID, '_client', true);
     253        $services = get_post_meta($post->ID, '_services', true); // Added
     254        $project_year = get_post_meta($post->ID, '_project_year', true); // Added
    253255        $budget = get_post_meta($post->ID, '_budget', true);
    254256        $location = get_post_meta($post->ID, '_location', true);
     
    260262            <p><label for="client"><?php esc_html_e('Client', 'portfolio-pro-advance'); ?></label>
    261263            <input type="text" id="client" name="client" value="<?php echo esc_attr($client); ?>" class="widefat"></p>
     264           
     265            <p><label for="services"><?php esc_html_e('Services', 'portfolio-pro-advance'); ?></label>
     266            <input type="text" id="services" name="services" value="<?php echo esc_attr($services); ?>" class="widefat"></p>
     267
     268            <p><label for="project_year"><?php esc_html_e('Project Year', 'portfolio-pro-advance'); ?></label>
     269            <input type="text" id="project_year" name="project_year" value="<?php echo esc_attr($project_year); ?>" class="widefat"></p>
     270
    262271            <p><label for="budget"><?php esc_html_e('Budget', 'portfolio-pro-advance'); ?></label>
    263272            <input type="text" id="budget" name="budget" value="<?php echo esc_attr($budget); ?>" class="widefat"></p>
     273           
    264274            <p><label for="location"><?php esc_html_e('Location', 'portfolio-pro-advance'); ?></label>
    265275            <input type="text" id="location" name="location" value="<?php echo esc_attr($location); ?>" class="widefat"></p>
     276           
    266277            <p><label for="team"><?php esc_html_e('Team', 'portfolio-pro-advance'); ?></label>
    267278            <input type="text" id="team" name="team" value="<?php echo esc_attr($team); ?>" class="widefat"></p>
     279           
    268280            <p><label for="timeline"><?php esc_html_e('Timeline', 'portfolio-pro-advance'); ?></label>
    269281            <input type="text" id="timeline" name="timeline" value="<?php echo esc_attr($timeline); ?>" class="widefat"></p>
     282           
    270283            <p><label>
    271284                <input type="checkbox" name="is_private" value="1" <?php checked($is_private, '1'); ?> />
     
    286299        if (!current_user_can('edit_post', $post_id)) return;
    287300
    288         foreach (['client', 'budget', 'location', 'team', 'timeline'] as $field) {
     301        // Added services and project_year to the array below
     302        foreach (['client', 'services', 'project_year', 'budget', 'location', 'team', 'timeline'] as $field) {
    289303            if (isset($_POST[$field])) {
    290304                update_post_meta($post_id, "_$field", sanitize_text_field(wp_unslash($_POST[$field])));
Note: See TracChangeset for help on using the changeset viewer.