WordPress.org

Ready to get started?Download WordPress

Forums

Fundify Crowdfunding (Moved)
Add category field to Edit/Submit Campaign? (5 posts)

  1. dlt0rre
    Member
    Posted 9 months ago #

    Hi!

    I would like to add a Categoy field to the Edit/Submit Campaign.
    So far I have made ​​the following changes in shortcode-submit.php file :
    - I added this line in the register_fields() function:

    'category' => array(
    				'label'       => __( 'Category', 'atcf' ),
    				'default'     => null,
    				'type'        => 'select_cat',
    				'editable'    => false,
    				'placeholder' => null,
    				'required'    => true,
    				'priority'    => 6
    			),

    - I added this line in the function __construct() :
    add_action( 'atcf_shortcode_submit_field_select_cat', 'atcf_shortcode_submit_field_select_cat', 10, 4 );
    - I created the function to generate the html code:

    [...]
    ?>
    	<p class="atcf-submit-campaign-<?php echo esc_attr( $key ); ?>">
    		<label for="<?php echo esc_attr( $key ); ?>"><?php echo apply_filters( 'atcf_shortcode_submit_field_label_' . $key, esc_attr( $field[ 'label' ] ) ); ?></label>
    
    		<select name="<?php echo esc_attr( $key ); ?>">
    
    		<?php
    				$terms = get_terms( 'download_category' );
    				if ( count( $terms ) > 0 ) {
    						/*echo "<option value=''>" . __( 'Show all categories', 'edd' ) . "</option>";*/
    						foreach ( $terms as $term ) {
    							$selected = isset( $_GET['download_category'] ) && $_GET['download_category'] == $term->slug ? ' selected="selected"' : '';
    							echo '<option value="' . esc_attr( $term->slug ) . '"' . $selected . '>' . esc_html( $term->name ) .' (' . $term->count .')</option>';
    						}
    				}
    		?>
    		</select>
    	</p>
    <?php
    }
    [...]

    The problem is, like you will know, that actually the selected category is stored in the BBDD as a extra field (campaign_category) but not as the real category.
    Can you help me please?
    Thank you!

    http://wordpress.org/plugins/appthemer-crowdfunding/

  2. interetinter
    Member
    Posted 9 months ago #

    Hi dlt0rre,

    If another user would like to provide input, they are more than welcome. On our end, customization support of any kind is outside the kind of support we provide.

    Thanks!

  3. dlt0rre
    Member
    Posted 9 months ago #

    thanks, I got it.

  4. Yukon Cornelius
    Member
    Posted 6 months ago #

    @interetinter so are you saying there is no way to categorize a campaign from the front end? Or have i missed a setting??? What about when i have 100s of campaigns running? Is an admin supposed to go in and manually categorize them all?

    @dlt0rre did you figure out a solution to this in the end. I HAVE to have front end categorization!

  5. beakid
    Member
    Posted 3 months ago #

    Also interested in how this was solved. @dlt0rre ?

Reply

You must log in to post.

About this Plugin

About this Topic