Home Forums Plugin Support WP Project Manager Pro Custom fields when adding a project

This topic is: not resolved

This topic contains 7 replies, has 3 voices, and was last updated by  Ruben 4 years, 2 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #21357

    matt
    Member
    Post count: 4

    Hello,

    I was wondering if you could point me in the right direction. I want to add some fields when creating a new project, (address, phone number, email, etc.). Any help would be greatly appreciated. I would like the fields to be available on both the fronted and backend. If I could just get some help on adding 1 custom field, I am sure I could figure out the rest. I am semi-proficent when it comes to adding/understanding code.

    Thanks so much!

    #21362

    Nizam Uddin
    Keymaster
    Post count: 670

    Hello Matt
    We don’t provide this type of customisation support. Please read our TOS. I can help you to find out the action hook. You will find a action hook cpm_project_form in line no 934 in html.php file of includes folder.

    Then you can use that action like the following

    add_action('cpm_project_form', array($this,'new_project_field'),10,1);
    
    function new_project_field($project){
            ?>
                    <label><?php _e('E-mail', 'cpm'); ?></label>
                    <input type="text" name="user_email">
    
            <?php
        }
    
    

    Thank you..

    #21363

    matt
    Member
    Post count: 4

    Would I place this new action in the function.php of the plugin?

    #21364

    Nizam Uddin
    Keymaster
    Post count: 670

    Put add_action inside the function __construct() and function new_project_field is inside the class in cpm.php file . If you are not developer please hire someone . Thank you

    #21365

    matt
    Member
    Post count: 4

    Thanks for your help. Kind of vague but helpful. Hope you are having a good morning.

    #21366

    matt
    Member
    Post count: 4

    I have opened a topic on the WordPress support site. They seem to help out and cater a little more to those of us without a complete understanding of coding. I do appreciate your time. Pretty cool plugin, minus the problem I am having adding a new field.

    #21404

    matt
    Member
    Post count: 4

    So, I figured it out. It was simple per your direction 🙂 Now, I just need to find out how to echo the information in /views/project/index.html

    Taking into account the action hook created above. Can you show me how you would implement the echo in the excerpt of code taken from the index.php file below

     <?php if ( $projects ) { ?>
    
            <?php foreach ($projects as $project) { ?>
                <article class="cpm-project">
                    <?php if ( cpm_is_project_archived( $project->ID ) ) { ?>
                        <div class="cpm-completed-wrap"><div class="ribbon-green"><?php _e( 'Completed', 'cpm' ); ?></div></div>
                    <?php } ?>
    
                    <a href="<?php echo cpm_url_project_details( $project->ID ); ?>">
                        <h5><?php echo get_the_title( $project->ID ); ?></h5>
    
                        <div class="cpm-project-detail"><?php echo cpm_excerpt( $project->post_content, 55 ); ?></div>
                        <div class="cpm-project-meta">
                            <?php echo cpm_project_summary( $project->info ); ?>
                        </div>
                        <div class="
                        
                        <footer class="cpm-project-people">
                            <div class="cpm-scroll">
                                <?php
                                if ( count( $project->users ) ) {
                                    foreach ($project->users as $id => $user_meta) {
    
                                        echo get_avatar( $id, 48, '', $user_meta['name'] );
                                    }
                                }
                                ?>
                            </div>
                        </footer>
                    </a>
    
                    <?php
    #36778

    Ruben
    Member
    Post count: 3

    Hi Matt,
    Did anyone reply to your request? I'm having the same problem!

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Custom fields when adding a project’ is closed to new replies.