PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.7.0.3
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.7.0.3
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / includes / admin / views / metaboxes / campaign-creator.php

campaign-creator.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.7.0.3, at includes/admin/views/metaboxes/campaign-creator.php

54 lines 2.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Renders the Campaign Creator metabox.
4 *
5 * @author David Bisset
6 * @copyright Copyright (c) 2022, WP Charitable LLC
7 * @package Charitable/Admin Views/Metaboxes
8 * @since 1.2.0
9 * @version 1.6.45
10 */
11
12 global $post, $wpdb;
13
14 /* If no post_author is set yet, WP returns 1, but we need to know if no creator is set. */
15 $creator_id = $wpdb->get_var( $wpdb->prepare( "SELECT post_author FROM $wpdb->posts WHERE ID = %d LIMIT 1", $post->ID ) );
16 $campaign = new Charitable_Campaign( $post );
17 $authors = get_users(
18 [
19 'orderby' => 'display_name',
20 'fields' => [ 'ID', 'display_name' ],
21 ]
22 );
23
24 ?>
25 <div id="charitable-campaign-creator-metabox-wrap" class="charitable-metabox-wrap">
26 <?php
27 if ( $creator_id ) :
28 $creator = new Charitable_User( $creator_id );
29 ?>
30 <div id="campaign-creator" class="charitable-media-block">
31 <div class="creator-avatar charitable-media-image">
32 <?php echo $creator->get_avatar(); ?>
33 </div><!--.creator-avatar-->
34 <div class="creator-facts charitable-media-body">
35 <h3 class="creator-name"><a href="<?php echo admin_url( 'user-edit.php?user_id=' . $creator->ID ); ?>"><?php printf( '%s (%s %d)', $creator->display_name, __( 'User ID', 'charitable-ambassadors' ), $creator->ID ); ?></a></h3>
36 <p><?php printf( '%s %s', _x( 'Joined on', 'joined on date', 'charitable-ambassadors' ), date_i18n( 'F Y', strtotime( $creator->user_registered ) ) ); ?></p>
37 <ul>
38 <li><a href="<?php echo get_author_posts_url( $creator->ID ); ?>"><?php _e( 'Public Profile', 'charitable-ambassadors' ); ?></a></li>
39 <li><a href="<?php echo admin_url( 'user-edit.php?user_id=' . $creator->ID ); ?>"><?php _e( 'Edit Profile', 'charitable' ); ?></a></li>
40 </ul>
41 </div><!--.creator-facts-->
42 </div><!--#campaign-creator-->
43 <?php endif; ?>
44 <div id="charitable-post-author-wrap" class="charitable-metabox charitable-select-wrap">
45 <label for="post_author_override"><?php _e( 'Change the campaign creator' ); ?></label>
46 <select name="post_author_override">
47 <option value="-" <?php selected( $creator_id, 0 ); ?>><?php _e( 'Select a user', 'charitable' ); ?></option>
48 <?php foreach ( $authors as $author ) : ?>
49 <option value="<?php echo esc_attr( $author->ID ); ?>" <?php selected( $creator_id, $author->ID ); ?>><?php echo $author->display_name; ?></option>
50 <?php endforeach; ?>
51 </select>
52 </div>
53 </div><!--#charitable-campaign-description-metabox-wrap-->
54