This topic contains 7 reply and 3 voices, and was last updated by Ruben 4 years, 8 months ago
Viewing 7 Posts - 1 through 7 (of 7 total)
Author Posts
June 2, 2014 at 6:45 pm 21357
Ruben 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!
June 2, 2014 at 7:32 pm 21362
Nizam Uddin Nizam Uddin

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..

June 2, 2014 at 8:10 pm 21363
matt matt

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

June 2, 2014 at 8:37 pm 21364
Nizam Uddin Nizam Uddin

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

June 2, 2014 at 9:12 pm 21365
matt matt

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

June 2, 2014 at 10:41 pm 21366
matt matt

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.

June 3, 2014 at 8:23 pm 21404
matt matt

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
February 16, 2015 at 9:39 am 36778
Ruben Ruben

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

Viewing 7 Posts - 1 through 7 (of 7 total)