Skip to content

Commit

Permalink
Kirki 4.0+ update
Browse files Browse the repository at this point in the history
Added 'Select a Page' option in page mapping setting
  • Loading branch information
vapvarun committed Feb 24, 2022
1 parent ed17fd8 commit 8b6f5c3
Show file tree
Hide file tree
Showing 9 changed files with 465 additions and 317 deletions.
85 changes: 74 additions & 11 deletions assets/css/buddypress.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
# BuddyPress Moderation
# BuddyPress Status
# BuddyPress Docs
# BuddyPress Reshare
--------------------------------------------------------------*/

Expand Down Expand Up @@ -3856,7 +3857,7 @@ body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list {


/*--------------------------------------------------------------
# BP Idea Stream
## BP Idea Stream
--------------------------------------------------------------*/

.wp-embed-share-tab-button {
Expand All @@ -3873,7 +3874,7 @@ body.buddypress.bp-user .buddypress-wrap .users-header .bp-member-type-list {


/*--------------------------------------------------------------
# BuddyPress Global Search
## BuddyPress Global Search
--------------------------------------------------------------*/

.search-results.buddypress-global-search form#searchform {
Expand Down Expand Up @@ -3947,7 +3948,7 @@ body.search-results.buddypress-global-search .bp-list li .action {


/*--------------------------------------------------------------
# BuddyPress Giphy
## BuddyPress Giphy
--------------------------------------------------------------*/

.bp-giphy-html-container,
Expand Down Expand Up @@ -3979,7 +3980,7 @@ body.search-results.buddypress-global-search .bp-list li .action {


/*--------------------------------------------------------------
# MediaPress
## MediaPress
--------------------------------------------------------------*/

form#mpp-whats-new-form p.activity-greeting {
Expand Down Expand Up @@ -4241,7 +4242,7 @@ div.mpp-bulk-edit-media-action-row select {


/*--------------------------------------------------------------
# BuddyPress Group Email Subscription
## BuddyPress Group Email Subscription
--------------------------------------------------------------*/

.buddyx-bpges .group-subscription-div #js-dialogtooltip {
Expand Down Expand Up @@ -4321,7 +4322,7 @@ button.ges-change:hover {


/*--------------------------------------------------------------
# BuddyPress Activity Plus
## BuddyPress Activity Plus
--------------------------------------------------------------*/

.bpfb_form_container {
Expand Down Expand Up @@ -4406,7 +4407,7 @@ input.bpfb_remote_image {


/*--------------------------------------------------------------
# BuddyPress Lock Unlock Activity
## BuddyPress Lock Unlock Activity
--------------------------------------------------------------*/

.activity-list.bp-list .activity-item .activity-meta.action .bplua-open-activity,
Expand All @@ -4432,7 +4433,7 @@ input.bpfb_remote_image {


/*--------------------------------------------------------------
# BuddyMessageUX-Free
## BuddyMessageUX-Free
--------------------------------------------------------------*/

.thickbox-loading #TB_ajaxContent {
Expand Down Expand Up @@ -4476,7 +4477,7 @@ input.bpfb_remote_image {


/*--------------------------------------------------------------
# BuddyPress Moderation
## BuddyPress Moderation
--------------------------------------------------------------*/

body.bmpro_moderation_content .member-home aside {
Expand All @@ -4491,7 +4492,7 @@ body.bmpro_moderation_content .member-home aside {


/*--------------------------------------------------------------
# BuddyPress Status
## BuddyPress Status
--------------------------------------------------------------*/

.bpstatus-icon {
Expand All @@ -4505,9 +4506,71 @@ body.bmpro_moderation_content .member-home aside {


/*--------------------------------------------------------------
# BuddyPress Docs
## BuddyPress Docs
--------------------------------------------------------------*/

ul.component-navigation.bp-docs-nav {
margin-left: 0;
}


/*--------------------------------------------------------------
## BuddyPress Reshare
--------------------------------------------------------------*/

.activity-share-modal .activity-list .activity-item .activity-header {
margin-bottom: 0;
}

.activity-list.bp-list .activity-reshare-item-container>.activity-item {
padding: 1rem;
margin: 1rem;
}

.post-reshare-item-container .post-preview {
margin-left: 15px;
margin-right: 15px;
}

.activity-list .activity-item .activity-meta.action .bp-activity-share-btn .bp-screen-reader-text {
margin-left: 0;
}

.bp-activity-share-button::before {
margin-right: 5px !important;
}

#bp-activity-share-widget-box-status-header .buddyx-content-wrp {
margin-top: 1rem;
}

.activity-list.bp-list .activity-reshare-item-container .activity-header {
padding-left: 65px;
padding-bottom: 10px;
}

.activity-share-modal .activity-list .activity-content .activity-inner img:not(.avatar),
.activity-list .activity-content .activity-inner .activity-reshare-item-container img:not(.avatar) {
width: 100%;
max-width: 100%;
margin: 0 0 15px;
}

.activity-share-modal .activity-list .activity-content .activity-inner .bb-post-title,
.activity-share-modal .activity-list .activity-content .activity-inner .buddyx-post-title,
.activity-list .activity-content .activity-inner .activity-reshare-item-container .bb-post-title,
.activity-list .activity-content .activity-inner .activity-reshare-item-container .buddyx-post-title {
display: block;
font-size: 20px;
margin: 0 0 10px;
}

.activity-list .activity-content .activity-inner .activity-reshare-item-container .buddyx-content-wrp p {
margin: 0 !important;
padding: 0;
}

.buddypress-wrap .activity-inner .activity-reshare-item-container p {
margin: 0 !important;
padding: 0 !important;
}
2 changes: 1 addition & 1 deletion assets/css/buddypress.min.css

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions assets/css/platform.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# BuddyPress Moderation Pro
# Profile Types
# GamiPress
# BuddyPress Reshare
# Profile Completion Widget
# Live Notification
--------------------------------------------------------------*/
Expand Down Expand Up @@ -983,6 +984,19 @@ body.wb-quote .activity-update-form #whats-new {
}


/*--------------------------------------------------------------
## BuddyPress Reshare
--------------------------------------------------------------*/

.activity-share-modal .activity-list .bb-activity-more-options-wrap {
display: none;
}

.activity-list .activity-item .activity-meta.action .bp-activity-share-btn .bp-screen-reader-text {
position: static;
}


/*--------------------------------------------------------------
# Profile Completion Widget
--------------------------------------------------------------*/
Expand Down
2 changes: 1 addition & 1 deletion assets/css/platform.min.css

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions inc/Dropdown_Select/Component.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* BuddyX\Buddyx\Dropdown_Select\Component class
*
* @package buddyx
*/

namespace BuddyX\Buddyx\Dropdown_Select;

use BuddyX\Buddyx\Component_Interface;
use Kirki\Field\Select;

/**
* Class to override kirki drop down pages field
*/
class Component extends Select implements Component_Interface {

/**
* Gets the unique identifier for the theme component.
*
* @return string Component slug.
*/
public function get_slug() : string {
return 'dropdown_select';
}

/**
* Adds the action and filter hooks to integrate with WordPress.
*/
public function initialize() {}

/**
* Filter arguments before creating the control.
*
* @access public
* @since 0.1
* @param array $args The field arguments.
* @param WP_Customize_Manager $wp_customize The customizer instance.
* @return array
*/
public function filter_control_args( $args, $wp_customize ) {

if ( 'buddyx_login_page' === $args['settings'] || 'buddyx_registration_page' === $args['settings'] || 'buddyx_404_page' === $args['settings'] ) {

$args = parent::filter_control_args( $args, $wp_customize );

$all_pages = get_pages();
$args['choices'][0] = __( '-- Select a Page --', 'buddyx' );

foreach ( $all_pages as $page ) {
$args['choices'][ $page->ID ] = $page->post_title;
}
}

return $args;
}

}
12 changes: 8 additions & 4 deletions inc/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Theme {
*
* @var array
*/
protected $components = [];
protected $components = array();

/**
* The template tags instance, providing access to all available template tags.
Expand All @@ -41,7 +41,7 @@ class Theme {
*
* @throws InvalidArgumentException Thrown if one of the $components does not implement Component_Interface.
*/
public function __construct( array $components = [] ) {
public function __construct( array $components = array() ) {
if ( empty( $components ) ) {
$components = $this->get_default_components();
}
Expand Down Expand Up @@ -134,7 +134,7 @@ public function component( string $slug ) : Component_Interface {
* @return array List of theme components to use by default.
*/
protected function get_default_components() : array {
$components = [
$components = array(
new Localization\Component(),
new Base_Support\Component(),
new Editor\Component(),
Expand All @@ -155,12 +155,16 @@ protected function get_default_components() : array {
new Kirki_Option\Component(),
new Custom_Js\Component(),
new Welcome\Component(),
];
);

if ( defined( 'JETPACK__VERSION' ) ) {
$components[] = new Jetpack\Component();
}

if ( defined( 'KIRKI_VERSION' ) && version_compare( KIRKI_VERSION, '4.0', '>=' ) ) {
$components[] = new Dropdown_Select\Component( $args );
}

return $components;
}
}
Loading

0 comments on commit 8b6f5c3

Please sign in to comment.