PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.8.13
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.8.13
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 1.7.0.9 All 211 releases
charitable / includes / admin / views / metaboxes / campaign-creator.php

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

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