mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
Merge pull request #1570 from ultimatemember/development/2.8.x
Version 2.9.0
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
/assets/libs/fontawesome/scss export-ignore
|
||||
/docs export-ignore
|
||||
/tests export-ignore
|
||||
/blocks-src export-ignore
|
||||
|
||||
# Files
|
||||
/.bowerrc export-ignore
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
name: Build Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
generate-translations:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: WordPress .pot File Generator
|
||||
uses: iamdharmesh/action-wordpress-pot-generator@main
|
||||
with:
|
||||
destination_path: './languages'
|
||||
slug: 'ultimate-member'
|
||||
text_domain: 'ultimate-member'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
build:
|
||||
needs: generate-translations
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install PHP
|
||||
uses: "shivammathur/setup-php@v2"
|
||||
with:
|
||||
php-version: "latest"
|
||||
- name: Install Composer Dependencies
|
||||
run: |
|
||||
composer install --no-progress --no-dev --optimize-autoloader --ignore-platform-req=ext-exif --ignore-platform-req=ext-gd --ignore-platform-req=ext-tidy
|
||||
- name: Commit files
|
||||
run: |
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git rm .bowerrc
|
||||
git rm .editorconfig
|
||||
git rm .gitignore
|
||||
git rm .jshintrc
|
||||
git rm .travis.yml
|
||||
git rm bower.json
|
||||
git rm composer.json
|
||||
git rm gulpfile.js
|
||||
git rm hookdoc-conf.json
|
||||
git rm manifest.json
|
||||
git rm package.json
|
||||
git rm package-lock.json
|
||||
git rm phpcs.xml
|
||||
git rm phpdoc.dist.xml
|
||||
git rm webpack.mix.js
|
||||
git rm -r .github
|
||||
git rm -r docs
|
||||
git rm -r blocks-src
|
||||
git rm -r tests
|
||||
git add vendor/\*
|
||||
git add includes/lib/action-scheduler/\*
|
||||
git commit -a -m "Composer Installed. Cleared release repo."
|
||||
- name: Push changes
|
||||
uses: ad-m/github-push-action@master
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: releases
|
||||
repository: ultimatemember/ultimatemember
|
||||
force: true
|
||||
@@ -1,20 +0,0 @@
|
||||
name: Generate POT file
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
WP_Generate_POT_File:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: WordPress .pot File Generator
|
||||
uses: iamdharmesh/action-wordpress-pot-generator@main
|
||||
with:
|
||||
destination_path: './languages'
|
||||
slug: 'ultimate-member'
|
||||
text_domain: 'ultimate-member'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -220,6 +220,7 @@ assets/vendor/
|
||||
package-lock.json
|
||||
.idea/
|
||||
composer.lock
|
||||
includes/lib/action-scheduler/
|
||||
|
||||
# exclude Composer installation
|
||||
composer.phar
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"step": "installPlugin",
|
||||
"pluginZipFile": {
|
||||
"resource": "url",
|
||||
"url": "https:\/\/downloads.wordpress.org\/plugin\/ultimate-member.2.8.9.zip"
|
||||
"url": "https:\/\/downloads.wordpress.org\/plugin\/ultimate-member.2.9.0.zip"
|
||||
},
|
||||
"options": {
|
||||
"activate": true
|
||||
|
||||
@@ -44,7 +44,7 @@ GNU Version 2 or Any Later Version
|
||||
|
||||
### IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
|
||||
|
||||
[Official Release Version: 2.8.9](https://github.com/ultimatemember/ultimatemember/releases/tag/2.8.9).
|
||||
[Official Release Version: 2.9.0](https://github.com/ultimatemember/ultimatemember/releases/tag/2.9.0).
|
||||
|
||||
## Changelog
|
||||
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
.um-admin.users-php .um_account_status {
|
||||
.um-admin.users-php .um-filter-by-status {
|
||||
padding: 0 8px 0 0;
|
||||
}
|
||||
.um-admin.users-php .um_account_status:not(.hidden) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
align-items: stretch;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
.um-admin.users-php .um_account_status span {
|
||||
.um-admin.users-php .um_account_status:not(.hidden) span {
|
||||
margin: 0 0 2px 0;
|
||||
padding: 0;
|
||||
}
|
||||
.um-admin.users-php .um_account_status ul {
|
||||
.um-admin.users-php .um_account_status:not(.hidden) ul {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
@@ -20,14 +23,14 @@
|
||||
margin: 0 0 4px 0;
|
||||
padding: 0;
|
||||
}
|
||||
.um-admin.users-php .um_account_status ul li {
|
||||
.um-admin.users-php .um_account_status:not(.hidden) ul li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.um-admin.users-php .um_account_status ul li a.um-set-status-rejected, .um-admin.users-php .um_account_status ul li a.um-deactivate-user {
|
||||
.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-set-status-rejected, .um-admin.users-php .um_account_status:not(.hidden) ul li a.um-deactivate-user {
|
||||
color: #b32d2e;
|
||||
}
|
||||
.um-admin.users-php .um_account_status ul li a.um-set-status-rejected:active, .um-admin.users-php .um_account_status ul li a.um-set-status-rejected:hover, .um-admin.users-php .um_account_status ul li a.um-deactivate-user:active, .um-admin.users-php .um_account_status ul li a.um-deactivate-user:hover {
|
||||
.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-set-status-rejected:active, .um-admin.users-php .um_account_status:not(.hidden) ul li a.um-set-status-rejected:hover, .um-admin.users-php .um_account_status:not(.hidden) ul li a.um-deactivate-user:active, .um-admin.users-php .um_account_status:not(.hidden) ul li a.um-deactivate-user:hover {
|
||||
color: #b32d2e;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.um-admin.users-php .um_account_status{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;flex-wrap:nowrap}.um-admin.users-php .um_account_status span{margin:0 0 2px 0;padding:0}.um-admin.users-php .um_account_status ul{display:flex;flex-direction:row;justify-content:flex-start;align-items:baseline;flex-wrap:wrap;column-gap:4px;row-gap:0;margin:0 0 4px 0;padding:0}.um-admin.users-php .um_account_status ul li{margin:0;padding:0}.um-admin.users-php .um_account_status ul li a.um-deactivate-user,.um-admin.users-php .um_account_status ul li a.um-set-status-rejected{color:#b32d2e}.um-admin.users-php .um_account_status ul li a.um-deactivate-user:active,.um-admin.users-php .um_account_status ul li a.um-deactivate-user:hover,.um-admin.users-php .um_account_status ul li a.um-set-status-rejected:active,.um-admin.users-php .um_account_status ul li a.um-set-status-rejected:hover{color:#b32d2e}.um-admin.users-php .subsubsub li.subsep{display:block;visibility:hidden;height:0}.um-admin-modal .um-admin-infobox label{font-weight:700;display:block;color:#333;cursor:default}.um-admin-modal .um-admin-infobox p{color:#666;padding-top:15px}.um-admin-modal .um-admin-infobox>p:not(:first-child){border-top:1px solid #e5e5e5}.um-admin-modal .um-admin-infobox>p:first-child{margin-top:0;padding-top:0}.um-admin-modal .um-admin-infobox>.um-row>p{border-top:1px solid #e5e5e5}.um-admin-modal .um-admin-infobox>.um-row>p:last-child{margin-bottom:0}#UM_preview_registration .um-admin-modal-foot{display:none}
|
||||
.um-admin.users-php .um-filter-by-status{padding:0 8px 0 0}.um-admin.users-php .um_account_status:not(.hidden){display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;flex-wrap:nowrap}.um-admin.users-php .um_account_status:not(.hidden) span{margin:0 0 2px 0;padding:0}.um-admin.users-php .um_account_status:not(.hidden) ul{display:flex;flex-direction:row;justify-content:flex-start;align-items:baseline;flex-wrap:wrap;column-gap:4px;row-gap:0;margin:0 0 4px 0;padding:0}.um-admin.users-php .um_account_status:not(.hidden) ul li{margin:0;padding:0}.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-deactivate-user,.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-set-status-rejected{color:#b32d2e}.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-deactivate-user:active,.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-deactivate-user:hover,.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-set-status-rejected:active,.um-admin.users-php .um_account_status:not(.hidden) ul li a.um-set-status-rejected:hover{color:#b32d2e}.um-admin.users-php .subsubsub li.subsep{display:block;visibility:hidden;height:0}.um-admin-modal .um-admin-infobox label{font-weight:700;display:block;color:#333;cursor:default}.um-admin-modal .um-admin-infobox p{color:#666;padding-top:15px}.um-admin-modal .um-admin-infobox>p:not(:first-child){border-top:1px solid #e5e5e5}.um-admin-modal .um-admin-infobox>p:first-child{margin-top:0;padding-top:0}.um-admin-modal .um-admin-infobox>.um-row>p{border-top:1px solid #e5e5e5}.um-admin-modal .um-admin-infobox>.um-row>p:last-child{margin-bottom:0}#UM_preview_registration .um-admin-modal-foot{display:none}
|
||||
@@ -2,7 +2,9 @@
|
||||
@import "mixins"
|
||||
|
||||
.#{$prefix}admin.users-php
|
||||
.um_account_status
|
||||
.um-filter-by-status
|
||||
padding: 0 8px 0 0
|
||||
.um_account_status:not(.hidden)
|
||||
+flex( column, flex-start, stretch, nowrap )
|
||||
span
|
||||
margin: 0 0 2px 0
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "um-block/um-account",
|
||||
"title": "Account",
|
||||
"description": "Displaying the account page of the current user",
|
||||
"icon": "id",
|
||||
"category": "um-blocks",
|
||||
"attributes": {
|
||||
"tab": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
||||
import { PanelBody, SelectControl } from "@wordpress/components";
|
||||
import { useMemo, useCallback } from '@wordpress/element';
|
||||
|
||||
registerBlockType('um-block/um-account', {
|
||||
edit: function (props) {
|
||||
const { attributes, setAttributes } = props;
|
||||
const { tab } = attributes;
|
||||
const blockProps = useBlockProps();
|
||||
|
||||
const options = useMemo(() => {
|
||||
const option = [{ label: wp.i18n.__('All', 'ultimate-member'), value: 'all' }];
|
||||
for (const key in um_account_settings) {
|
||||
if (um_account_settings.hasOwnProperty(key) && um_account_settings[key]['enabled']) {
|
||||
option.push({
|
||||
label: um_account_settings[key]['label'],
|
||||
value: key
|
||||
});
|
||||
}
|
||||
}
|
||||
return option;
|
||||
}, []);
|
||||
|
||||
const onTabChange = useCallback((value) => {
|
||||
setAttributes({ tab: value });
|
||||
const shortcode = `[ultimatemember_account${value !== 'all' ? ` tab="${value}"` : ''}]`;
|
||||
setAttributes({ content: shortcode });
|
||||
}, [setAttributes]);
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-account" attributes={attributes} />
|
||||
<InspectorControls>
|
||||
<PanelBody title={wp.i18n.__('Account Tab', 'ultimate-member')}>
|
||||
<SelectControl
|
||||
label={wp.i18n.__('Select Tab', 'ultimate-member')}
|
||||
className="um_select_account_tab"
|
||||
value={tab}
|
||||
options={options}
|
||||
style={{ height: '35px', lineHeight: '20px', padding: '0 7px' }}
|
||||
onChange={onTabChange}
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
save: () => null
|
||||
});
|
||||
|
||||
jQuery(window).on( 'load', function($) {
|
||||
let observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
|
||||
jQuery(mutation.addedNodes).find('.um.um-account').each(function() {
|
||||
let current_tab = jQuery(this).find('.um-account-main').attr('data-current_tab');
|
||||
let wrapper = document.querySelector('.um-form');
|
||||
|
||||
if ( current_tab ) {
|
||||
jQuery(this).find('.um-account-tab[data-tab="'+current_tab+'"]').show();
|
||||
jQuery(this).find('.um-account-tab:not(:visible)').find( 'input, select, textarea' ).not( ':disabled' ).addClass('um_account_inactive').prop( 'disabled', true ).attr( 'disabled', true );
|
||||
um_responsive();
|
||||
}
|
||||
|
||||
if (wrapper) {
|
||||
wrapper.addEventListener('click', (event) => {
|
||||
if (event.target !== wrapper) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "um-block/um-forms",
|
||||
"title": "Form",
|
||||
"description": "Choose display form",
|
||||
"icon": "forms",
|
||||
"category": "um-blocks",
|
||||
"attributes": {
|
||||
"form_id": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { PanelBody, SelectControl, Spinner } from '@wordpress/components';
|
||||
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import { useMemo } from '@wordpress/element';
|
||||
|
||||
registerBlockType('um-block/um-forms', {
|
||||
edit: function (props) {
|
||||
const blockProps = useBlockProps();
|
||||
const { attributes, setAttributes } = props;
|
||||
const { form_id } = attributes;
|
||||
|
||||
const posts = useSelect(
|
||||
(select) => select('core').getEntityRecords('postType', 'um_form', { per_page: -1, _fields: ['id', 'title'] }),
|
||||
[]
|
||||
);
|
||||
|
||||
const options = useMemo(() => {
|
||||
if (!posts) {
|
||||
return [{ label: wp.i18n.__('Loading...', 'ultimate-member'), value: '' }];
|
||||
}
|
||||
if (posts.length === 0) {
|
||||
return [{ label: wp.i18n.__('No forms found.', 'ultimate-member'), value: '' }];
|
||||
}
|
||||
return [{ label: wp.i18n.__('Select Form', 'ultimate-member'), value: '' }].concat(
|
||||
posts.map((post) => ({ label: post.title.rendered, value: post.id }))
|
||||
);
|
||||
}, [posts]);
|
||||
|
||||
const onFormChange = (value) => setAttributes({ form_id: value });
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-forms" attributes={attributes} />
|
||||
<InspectorControls>
|
||||
<PanelBody title={wp.i18n.__('Select Forms', 'ultimate-member')}>
|
||||
<SelectControl
|
||||
label={wp.i18n.__('Select Forms', 'ultimate-member')}
|
||||
className="um_select_forms"
|
||||
value={form_id}
|
||||
options={options}
|
||||
onChange={onFormChange}
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
save: () => null
|
||||
});
|
||||
|
||||
jQuery(window).on( 'load', function($) {
|
||||
let observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
|
||||
jQuery(mutation.addedNodes).find('.um-form').each(function() {
|
||||
let wrapper = document.querySelector('.um-form');
|
||||
|
||||
if (wrapper) {
|
||||
wrapper.addEventListener('click', (event) => {
|
||||
if (event.target !== wrapper) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "um-block/um-member-directories",
|
||||
"title": "Member Directory",
|
||||
"description": "Choose display directory",
|
||||
"icon": "groups",
|
||||
"category": "um-blocks",
|
||||
"attributes": {
|
||||
"member_id": {
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { PanelBody, SelectControl, Spinner } from '@wordpress/components';
|
||||
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { registerBlockType } from "@wordpress/blocks";
|
||||
import { useMemo } from '@wordpress/element';
|
||||
|
||||
registerBlockType('um-block/um-member-directories', {
|
||||
edit: function (props) {
|
||||
const blockProps = useBlockProps();
|
||||
const { attributes, setAttributes } = props;
|
||||
const { member_id } = attributes;
|
||||
|
||||
const posts = useSelect((select) => {
|
||||
return select('core').getEntityRecords('postType', 'um_directory', {
|
||||
per_page: -1,
|
||||
_fields: ['id', 'title']
|
||||
});
|
||||
}, []);
|
||||
|
||||
const options = useMemo(() => {
|
||||
if (!posts) {
|
||||
return [{ label: wp.i18n.__('Loading...', 'ultimate-member'), value: '' }];
|
||||
}
|
||||
if (posts.length === 0) {
|
||||
return [{ label: wp.i18n.__('No posts found.', 'ultimate-member'), value: '' }];
|
||||
}
|
||||
return [{ label: wp.i18n.__('Select Directory', 'ultimate-member'), value: '' }].concat(
|
||||
posts.map((post) => ({
|
||||
label: post.title.rendered,
|
||||
value: post.id
|
||||
}))
|
||||
);
|
||||
}, [posts]);
|
||||
|
||||
const onMemberIdChange = (value) => setAttributes({ member_id: value });
|
||||
|
||||
if (!posts) {
|
||||
return (
|
||||
<p>
|
||||
<Spinner />
|
||||
{wp.i18n.__('Loading...', 'ultimate-member')}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-member-directories" attributes={attributes} />
|
||||
<InspectorControls>
|
||||
<PanelBody title={wp.i18n.__('Select Directories', 'ultimate-member')}>
|
||||
<SelectControl
|
||||
label={wp.i18n.__('Select Directories', 'ultimate-member')}
|
||||
className="um_select_directory"
|
||||
value={member_id}
|
||||
options={options}
|
||||
onChange={onMemberIdChange}
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
save: () => null
|
||||
});
|
||||
|
||||
jQuery(window).on( 'load', function($) {
|
||||
let observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
|
||||
jQuery(mutation.addedNodes).find('.um.um-directory').each(function() {
|
||||
let wrapper = document.querySelector('.um-directory');
|
||||
let directory = jQuery(this);
|
||||
um_ajax_get_members( directory );
|
||||
um_slider_filter_init( directory );
|
||||
um_datepicker_filter_init( directory );
|
||||
um_timepicker_filter_init( directory );
|
||||
|
||||
if (wrapper) {
|
||||
wrapper.addEventListener('click', (event) => {
|
||||
if (event.target !== wrapper) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
jQuery(mutation.addedNodes).find('.um-member').each(function() {
|
||||
let wrapper = document.querySelector('.um-member');
|
||||
let directory = jQuery(this).parent();
|
||||
UM_Member_Grid(directory);
|
||||
|
||||
if (wrapper) {
|
||||
wrapper.addEventListener('click', (event) => {
|
||||
if (event.target !== wrapper) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"apiVersion": 2,
|
||||
"name": "um-block/um-password-reset",
|
||||
"title": "Password Reset",
|
||||
"description": "Displaying the password reset form",
|
||||
"icon": "unlock",
|
||||
"category": "um-blocks",
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { useBlockProps } from '@wordpress/block-editor';
|
||||
|
||||
registerBlockType('um-block/um-password-reset', {
|
||||
edit: function () {
|
||||
const blockProps = useBlockProps();
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-password-reset" />
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
||||
save: () => null
|
||||
});
|
||||
@@ -1,5 +1,21 @@
|
||||
== Changelog ==
|
||||
|
||||
= 2.9.0 November 12, 2024 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
- Added: Action Scheduler (version 3.8.1) for email sending. More info is [here](https://actionscheduler.org/)
|
||||
- Added: Supporting new `wp_register_block_metadata_collection()` function for registering WP Blocks
|
||||
|
||||
* Bugfixes:
|
||||
|
||||
- Fixed: `ajax_image_upload()` and `ajax_resize_image()` handlers vulnerability. CVE ID: CVE-2024-10528
|
||||
- Fixed: Disabling user status column wp-admin > Users screen
|
||||
- Fixed: User status filter on wp-admin > Users on mobile devices
|
||||
- Fixed: Extra unwrapping of the WP Editor field's value
|
||||
|
||||
* Cached and optimized/minified assets(JS/CSS) must be flushed/re-generated after upgrade
|
||||
|
||||
= 2.8.9 October 14, 2024 =
|
||||
|
||||
* Enhancements:
|
||||
|
||||
+5
-3
@@ -9,7 +9,8 @@
|
||||
"config": {
|
||||
"allow-plugins": {
|
||||
"symfony/flex": true,
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true
|
||||
"dealerdirect/phpcodesniffer-composer-installer": true,
|
||||
"composer/installers": true
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
@@ -22,7 +23,8 @@
|
||||
"ext-curl": "*",
|
||||
"ext-iconv": "*",
|
||||
"ext-tidy": "*",
|
||||
"woocommerce/action-scheduler": "3.2.1"
|
||||
"composer/installers": "^2.3",
|
||||
"woocommerce/action-scheduler": "3.8.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"roave/security-advisories": "dev-latest",
|
||||
@@ -36,7 +38,7 @@
|
||||
},
|
||||
"extra": {
|
||||
"installer-paths": {
|
||||
"vendor/{$vendor}/{$name}/": ["woocommerce/action-scheduler"]
|
||||
"includes/lib/{$name}/": ["woocommerce/action-scheduler"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,299 @@
|
||||
<?php
|
||||
namespace um\action_scheduler;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'um\action_scheduler\Init' ) ) {
|
||||
|
||||
/**
|
||||
* Class Init
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @package um\action_scheduler
|
||||
*/
|
||||
class Init {
|
||||
|
||||
/**
|
||||
* Global variable if Action Scheduler is active.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $enabled = false;
|
||||
|
||||
/**
|
||||
* Action Scheduler group
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $default_group = 'ultimate-member';
|
||||
|
||||
/**
|
||||
* Path to library
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $lib_path = UM_PATH . 'includes/lib/action-scheduler/action-scheduler.php';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct() {
|
||||
if ( ! $this->can_be_active() ) {
|
||||
UM()->admin()->notices()->add_notice(
|
||||
'um-action-scheduler',
|
||||
array(
|
||||
'class' => 'notice-warning is-dismissible',
|
||||
// translators: %1$s - Plugin name, %1$s - Plugin Version
|
||||
'message' => '<p>' . sprintf( __( '<strong>%1$s %2$s</strong> The file needed to enable the Action Scheduler is missing. The plugin will continue to function as it did before, but without the new benefits offered by the Action Scheduler.', 'ultimate-member' ), UM_PLUGIN_NAME, UM_VERSION ) . '</p>',
|
||||
)
|
||||
);
|
||||
} else {
|
||||
add_filter( 'um_settings_structure', array( $this, 'add_setting' ) );
|
||||
|
||||
if ( UM()->options()->get( 'enable_action_scheduler' ) ) {
|
||||
$this->enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the Action Scheduler setting to Ultimate Member feature settings
|
||||
*
|
||||
* @param array $settings
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function add_setting( $settings ) {
|
||||
$settings['advanced']['sections']['features']['form_sections']['features']['fields'][] = array(
|
||||
'id' => 'enable_action_scheduler',
|
||||
'type' => 'checkbox',
|
||||
'label' => __( 'Action Scheduler', 'ultimate-member' ),
|
||||
'checkbox_label' => __( 'Enable Action Scheduler', 'ultimate-member' ),
|
||||
'description' => __( 'Check this box if you want to use the Ultimate Member action scheduler. By enabling it, certain tasks like sending system emails will be scheduled to run at optimal times, which can help reduce the load on your server', 'ultimate-member' ),
|
||||
);
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies whether WooCommerce is installed and activated,
|
||||
* and checks for the existence of the WooCommerce Action Scheduler file.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function verify_wc_action_scheduler() {
|
||||
if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$action_scheduler_file = WP_PLUGIN_DIR . '/woocommerce/packages/action-scheduler/action-scheduler.php';
|
||||
|
||||
return file_exists( $action_scheduler_file );
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to load Action Scheduler from Ultimate Member if file exists
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function load_library() {
|
||||
if ( file_exists( $this->lib_path ) ) {
|
||||
require_once $this->lib_path;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whenever Action Scheduler can be active
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function can_be_active() {
|
||||
return $this->verify_wc_action_scheduler() || $this->load_library();
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue an action to run one time, as soon as possible.
|
||||
* If Action Scheduler is disabled then do_action_ref_array is called to run action right away.
|
||||
*
|
||||
* @param string $hook Required. Name of the action hook.
|
||||
* @param array $args Arguments to pass to callbacks when the hook triggers. Default: array().
|
||||
* @param string $group The group to assign this job to. Default: ''.
|
||||
* @param bool $unique Whether the action should be unique. Default: false.
|
||||
* @param int $priority Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255.
|
||||
*
|
||||
* @return int Еhe action’s ID. Zero if there was an error scheduling the action. The error will be sent to error_log
|
||||
*/
|
||||
public function enqueue_async_action( $hook, $args = array(), $group = '', $unique = false, $priority = 10 ) {
|
||||
if ( $this->enabled ) {
|
||||
$group = $this->set_group( $group );
|
||||
return as_enqueue_async_action( $hook, $args, $group, $unique, $priority );
|
||||
}
|
||||
|
||||
do_action_ref_array( $hook, $args );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule an action to run one time at some defined point in the future.
|
||||
*
|
||||
* @param int $timestamp Required. The Unix timestamp representing the date you want the action to run.
|
||||
* @param string $hook Required. Name of the action hook.
|
||||
* @param array $args Arguments to pass to callbacks when the hook triggers. Default: array()
|
||||
* @param string $group The group to assign this job to. Default: ''.
|
||||
* @param bool $unique Whether the action should be unique. Default: false.
|
||||
* @param int $priority Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255.)
|
||||
*
|
||||
* @return int The action’s ID. Zero if there was an error scheduling the action. The error will be sent to error_log.
|
||||
*/
|
||||
public function schedule_single_action( $timestamp, $hook, $args = array(), $group = '', $unique = false, $priority = 10 ) {
|
||||
if ( $this->enabled ) {
|
||||
$group = $this->set_group( $group );
|
||||
return as_schedule_single_action( $timestamp, $hook, $args, $group, $unique, $priority );
|
||||
}
|
||||
|
||||
do_action_ref_array( $hook, $args );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule an action to run repeatedly with a specified interval in seconds.
|
||||
*
|
||||
* @param int $timestamp Required. The Unix timestamp representing the date you want the action to run.
|
||||
* @param int $interval_in_seconds Required. How long to wait between runs.
|
||||
* @param string $hook Required. Name of the action hook.
|
||||
* @param array $args Arguments to pass to callbacks when the hook triggers. Default: array().
|
||||
* @param string $group The group to assign this job to. Default: ''.
|
||||
* @param bool $unique Whether the action should be unique. Default: false.
|
||||
* @param int $priority Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255.
|
||||
*
|
||||
* @return int The action’s ID. Zero if there was an error scheduling the action. The error will be sent to error_log.
|
||||
*/
|
||||
public function schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args = array(), $group = '', $unique = false, $priority = 10 ) {
|
||||
$group = $this->set_group( $group );
|
||||
|
||||
return as_schedule_recurring_action( $timestamp, $interval_in_seconds, $hook, $args, $group, $unique, $priority );
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule an action that recurs on a cron-like schedule.
|
||||
*
|
||||
* If execution of a cron-like action is delayed, the next attempt will still be scheduled according to the provided cron expression.
|
||||
*
|
||||
* @param int $timestamp Required. The Unix timestamp representing the date you want the action to run.
|
||||
* @param string $schedule Required. A cron-like schedule string, see http://en.wikipedia.org/wiki/Cron.
|
||||
* @param string $hook Required Name of the action hook.
|
||||
* @param array $args Arguments to pass to callbacks when the hook triggers. Default: array().
|
||||
* @param string $group The group to assign this job to. Default: ''.
|
||||
* @param bool $unique Whether the action should be unique. Default: false.
|
||||
* @param int $priority Lower values take precedence over higher values. Defaults to 10, with acceptable values falling in the range 0-255.
|
||||
*
|
||||
* @return int The action’s ID. Zero if there was an error scheduling the action. The error will be sent to error_log.
|
||||
*/
|
||||
public function schedule_cron_action( $timestamp, $schedule, $hook, $args = array(), $group = '', $unique = false, $priority = 10 ) {
|
||||
$group = $this->set_group( $group );
|
||||
|
||||
return as_schedule_cron_action( $timestamp, $schedule, $hook, $args, $group, $unique, $priority );
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel the next occurrence of a scheduled action.
|
||||
*
|
||||
* @param string $hook Required. Name of the action hook.
|
||||
* @param array $args Arguments passed to callbacks when the hook triggers. Default: array().
|
||||
* @param string $group The group the job is assigned to. Default: ''.
|
||||
*
|
||||
* @return int|null The scheduled action ID if a scheduled action was found, or null if no matching action found.
|
||||
*/
|
||||
public function unschedule_action( $hook, $args = array(), $group = '' ) {
|
||||
$group = $this->set_group( $group );
|
||||
|
||||
return as_unschedule_action( $hook, $args, $group );
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel all occurrences of a scheduled action.
|
||||
*
|
||||
* @param string $hook The hook that the job will trigger.
|
||||
* @param array $args Args that would have been passed to the job.
|
||||
* @param string $group The group the job is assigned to.
|
||||
*/
|
||||
public function unschedule_all_actions( $hook, $args = array(), $group = '' ) {
|
||||
$group = $this->set_group( $group );
|
||||
|
||||
as_unschedule_all_actions( $hook, $args, $group );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the next timestamp for a scheduled action.
|
||||
*
|
||||
* @param string $hook Required. Name of the action hook. Default: none.
|
||||
* @param array $args Arguments passed to callbacks when the hook triggers. Default: array().
|
||||
* @param string $group The group the job is assigned to. Default: ''.
|
||||
*
|
||||
* @return int|bool The timestamp for the next occurrence of a pending scheduled action, true for an async or in-progress action or false if there is no matching action.
|
||||
*/
|
||||
public function next_scheduled_action( $hook, $args = array(), $group = '' ) {
|
||||
$group = $this->set_group( $group );
|
||||
|
||||
return as_next_scheduled_action( $hook, $args, $group );
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if there is a scheduled action in the queue, but more efficiently than as_next_scheduled_action().
|
||||
* It’s recommended to use this function when you need to know whether a specific action is currently scheduled.
|
||||
*
|
||||
* @param string $hook Required. Name of the action hook. Default: none.
|
||||
* @param array $args Arguments passed to callbacks when the hook triggers. Default: array().
|
||||
* @param string $group The group the job is assigned to. Default: ''.
|
||||
*
|
||||
* @return bool True if a matching action is pending or in-progress, false otherwise.
|
||||
*/
|
||||
public function has_scheduled_action( $hook, $args = array(), $group = '' ) {
|
||||
$group = $this->set_group( $group );
|
||||
|
||||
return as_has_scheduled_action( $hook, $args, $group );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $args Arguments to search and filter results by. Possible arguments, with their default values:
|
||||
* 'hook' => '' - the name of the action that will be triggered
|
||||
* 'args' => NULL - the args array that will be passed with the action
|
||||
* 'date' => NULL - the scheduled date of the action. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime().
|
||||
* 'date_compare' => '<=' - operator for testing “date”. accepted values are ‘!=’, ‘>’, ‘>=’, ‘<’, ‘<=’, ‘=’
|
||||
* 'modified' => NULL - the date the action was last updated. Expects a DateTime object, a unix timestamp, or a string that can parsed with strtotime().
|
||||
* 'modified_compare' => '<=' - operator for testing “modified”. accepted values are ‘!=’, ‘>’, ‘>=’, ‘<’, ‘<=’, ‘=’
|
||||
* 'group' => '' - the group the action belongs to
|
||||
* 'status' => '' - ActionScheduler_Store::STATUS_COMPLETE or ActionScheduler_Store::STATUS_PENDING
|
||||
* 'claimed' => NULL - TRUE to find claimed actions, FALSE to find unclaimed actions, a string to find a specific claim ID
|
||||
* 'per_page' => 5 - Number of results to return
|
||||
* 'offset' => 0
|
||||
* 'orderby' => 'date' - accepted values are ‘hook’, ‘group’, ‘modified’, or ‘date’
|
||||
* 'order' => 'ASC'
|
||||
*
|
||||
* @param string $return_format The format in which to return the scheduled actions: 'OBJECT', 'ARRAY_A', or 'ids'. Default: 'OBJECT'.
|
||||
*
|
||||
* @return array Array of action rows matching the criteria specified with $args.
|
||||
*/
|
||||
public function get_scheduled_actions( $args, $return_format = 'OBJECT' ) {
|
||||
if ( ! empty( $args['group'] ) ) {
|
||||
$args['group'] = $this->set_group( $args['group'] );
|
||||
}
|
||||
return as_get_scheduled_actions( $args, $return_format );
|
||||
}
|
||||
|
||||
public function set_group( $group ) {
|
||||
if ( empty( $group ) ) {
|
||||
return $this->default_group;
|
||||
}
|
||||
|
||||
return $this->default_group . '_' . $group;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,7 +360,7 @@ if ( ! class_exists( 'um\admin\Users_Columns' ) ) {
|
||||
|
||||
$statuses = $this->get_statuses_filter_options();
|
||||
?>
|
||||
<div class="alignleft actions um-filter-by-status">
|
||||
<div class="alignleft um-filter-by-status">
|
||||
<label class="screen-reader-text" for="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'All Statuses', 'ultimate-member' ); ?></label>
|
||||
<select name="<?php echo esc_attr( $id ); ?>" id="<?php echo esc_attr( $id ); ?>">
|
||||
<option value=""><?php esc_html_e( 'All Statuses', 'ultimate-member' ); ?></option>
|
||||
|
||||
@@ -543,7 +543,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'size' => 'medium',
|
||||
),
|
||||
array(
|
||||
'id' => 'a$access_fieldsccess_redirect',
|
||||
'id' => 'access_redirect',
|
||||
'type' => 'text',
|
||||
'label' => __( 'Custom Redirect URL', 'ultimate-member' ),
|
||||
'description' => __( 'A logged out user will be redirected to this url If he is not permitted to access the site.', 'ultimate-member' ),
|
||||
@@ -1005,6 +1005,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
|
||||
'enable_blocks' => array(
|
||||
'sanitize' => 'bool',
|
||||
),
|
||||
'enable_action_scheduler' => array(
|
||||
'sanitize' => 'bool',
|
||||
),
|
||||
'rest_api_version' => array(
|
||||
'sanitize' => 'text',
|
||||
),
|
||||
|
||||
@@ -14,7 +14,7 @@ if ( ! empty( $_GET['_wp_http_referer'] ) ) {
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_List_Table' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ KEY meta_key_indx (um_key),
|
||||
KEY meta_value_indx (um_value(191))
|
||||
) $charset_collate;";
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
|
||||
dbDelta( $sql );
|
||||
|
||||
update_option( 'um_last_version_upgrade', '2.1.3-beta3' );
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
// This file is generated. Do not modify it manually.
|
||||
return array(
|
||||
'um-account' => array(
|
||||
'apiVersion' => 2,
|
||||
'name' => 'um-block/um-account',
|
||||
'title' => 'Account',
|
||||
'description' => 'Displaying the account page of the current user',
|
||||
'icon' => 'id',
|
||||
'category' => 'um-blocks',
|
||||
'attributes' => array(
|
||||
'tab' => array(
|
||||
'type' => 'string'
|
||||
)
|
||||
),
|
||||
'editorScript' => 'file:./src/index.js',
|
||||
'textdomain' => 'ultimate-member'
|
||||
),
|
||||
'um-forms' => array(
|
||||
'apiVersion' => 2,
|
||||
'name' => 'um-block/um-forms',
|
||||
'title' => 'Form',
|
||||
'description' => 'Choose display form',
|
||||
'icon' => 'forms',
|
||||
'category' => 'um-blocks',
|
||||
'attributes' => array(
|
||||
'form_id' => array(
|
||||
'type' => 'integer'
|
||||
)
|
||||
),
|
||||
'editorScript' => 'file:./src/index.js',
|
||||
'textdomain' => 'ultimate-member'
|
||||
),
|
||||
'um-member-directories' => array(
|
||||
'apiVersion' => 2,
|
||||
'name' => 'um-block/um-member-directories',
|
||||
'title' => 'Member Directory',
|
||||
'description' => 'Choose display directory',
|
||||
'icon' => 'groups',
|
||||
'category' => 'um-blocks',
|
||||
'attributes' => array(
|
||||
'member_id' => array(
|
||||
'type' => 'integer'
|
||||
)
|
||||
),
|
||||
'editorScript' => 'file:./src/index.js',
|
||||
'textdomain' => 'ultimate-member'
|
||||
),
|
||||
'um-password-reset' => array(
|
||||
'apiVersion' => 2,
|
||||
'name' => 'um-block/um-password-reset',
|
||||
'title' => 'Password Reset',
|
||||
'description' => 'Displaying the password reset form',
|
||||
'icon' => 'unlock',
|
||||
'category' => 'um-blocks',
|
||||
'editorScript' => 'file:./src/index.js',
|
||||
'textdomain' => 'ultimate-member'
|
||||
)
|
||||
);
|
||||
@@ -10,6 +10,6 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./build/index.js",
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-server-side-render'), 'version' => '98a99fd44cd9deb95734');
|
||||
@@ -1 +0,0 @@
|
||||
(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.wp.element,n=window.wp.blocks,a=window.wp.serverSideRender;var o=t.n(a);const u=window.wp.blockEditor,r=window.wp.components;(0,n.registerBlockType)("um-block/um-account",{edit:function(t){let{tab:n,setAttributes:a}=t.attributes;const c=(0,u.useBlockProps)();return(0,e.createElement)("div",c,(0,e.createElement)(o(),{block:"um-block/um-account",attributes:t.attributes}),(0,e.createElement)(u.InspectorControls,null,(0,e.createElement)(r.PanelBody,{title:wp.i18n.__("Account Tab","ultimate-member")},(0,e.createElement)(r.SelectControl,{label:wp.i18n.__("Select Tab","ultimate-member"),className:"um_select_account_tab",value:n,options:function(){var t=[];for(var e in t.push({label:wp.i18n.__("All","ultimate-member"),value:"all"}),um_account_settings)um_account_settings.hasOwnProperty(e)&&um_account_settings[e].enabled&&t.push({label:um_account_settings[e].label,value:e});return t}(),style:{height:"35px",lineHeight:"20px",padding:"0 7px"},onChange:e=>{t.setAttributes({tab:e}),function(e){var n="[ultimatemember_account";"all"!==e&&(n=n+' tab="'+e+'"'),n+="]",t.setAttributes({content:n})}(e)}}))))},save:function(t){return null}}),jQuery(window).on("load",(function(t){new MutationObserver((function(t){t.forEach((function(t){jQuery(t.addedNodes).find(".um.um-account").each((function(){var t=jQuery(this).find(".um-account-main").attr("data-current_tab");t&&(jQuery(this).find('.um-account-tab[data-tab="'+t+'"]').show(),jQuery(this).find(".um-account-tab:not(:visible)").find("input, select, textarea").not(":disabled").addClass("um_account_inactive").prop("disabled",!0).attr("disabled",!0),um_responsive(),um_modal_responsive())}))}))})).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}))})();
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-server-side-render'), 'version' => 'a9e99ac324b1bd5538e3');
|
||||
@@ -1,88 +1 @@
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import {InspectorControls, useBlockProps} from '@wordpress/block-editor';
|
||||
import {PanelBody, SelectControl} from "@wordpress/components";
|
||||
|
||||
registerBlockType('um-block/um-account', {
|
||||
edit: function (props) {
|
||||
let { tab, setAttributes } = props.attributes;
|
||||
const blockProps = useBlockProps();
|
||||
|
||||
function get_options() {
|
||||
var option = [];
|
||||
|
||||
option.push( { label: wp.i18n.__( 'All', 'ultimate-member' ), value: 'all' } );
|
||||
|
||||
for ( var key in um_account_settings ) {
|
||||
if ( um_account_settings.hasOwnProperty( key ) && um_account_settings[ key ]['enabled'] ) {
|
||||
option.push(
|
||||
{
|
||||
label: um_account_settings[ key ]['label'],
|
||||
value: key
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
function umShortcode( value ) {
|
||||
|
||||
var shortcode = '[ultimatemember_account';
|
||||
|
||||
if ( value !== 'all' ) {
|
||||
shortcode = shortcode + ' tab="' + value + '"';
|
||||
}
|
||||
|
||||
shortcode = shortcode + ']';
|
||||
|
||||
props.setAttributes({ content: shortcode });
|
||||
}
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-account" attributes={props.attributes} />
|
||||
<InspectorControls>
|
||||
<PanelBody title={wp.i18n.__('Account Tab', 'ultimate-member')}>
|
||||
<SelectControl
|
||||
label={wp.i18n.__('Select Tab', 'ultimate-member')}
|
||||
className="um_select_account_tab"
|
||||
value={tab}
|
||||
options={get_options()}
|
||||
style={{ height: '35px', lineHeight: '20px', padding: '0 7px' }}
|
||||
onChange={(value) => {
|
||||
props.setAttributes({ tab: value });
|
||||
umShortcode(value);
|
||||
}}
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
save: function save(props) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(window).on( 'load', function($) {
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
|
||||
jQuery(mutation.addedNodes).find('.um.um-account').each(function() {
|
||||
var current_tab = jQuery(this).find('.um-account-main').attr('data-current_tab');
|
||||
|
||||
if ( current_tab ) {
|
||||
jQuery(this).find('.um-account-tab[data-tab="'+current_tab+'"]').show();
|
||||
jQuery(this).find('.um-account-tab:not(:visible)').find( 'input, select, textarea' ).not( ':disabled' ).addClass('um_account_inactive').prop( 'disabled', true ).attr( 'disabled', true );
|
||||
um_responsive();
|
||||
// um_modal_responsive();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
|
||||
});
|
||||
(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.wp.blocks,n=window.wp.serverSideRender;var a=t.n(n);const o=window.wp.blockEditor,c=window.wp.components,u=window.wp.element,i=window.ReactJSXRuntime;(0,e.registerBlockType)("um-block/um-account",{edit:function(t){const{attributes:e,setAttributes:n}=t,{tab:r}=e,s=(0,o.useBlockProps)(),l=(0,u.useMemo)((()=>{const t=[{label:wp.i18n.__("All","ultimate-member"),value:"all"}];for(const e in um_account_settings)um_account_settings.hasOwnProperty(e)&&um_account_settings[e].enabled&&t.push({label:um_account_settings[e].label,value:e});return t}),[]),d=(0,u.useCallback)((t=>{n({tab:t}),n({content:`[ultimatemember_account${"all"!==t?` tab="${t}"`:""}]`})}),[n]);return(0,i.jsxs)("div",{...s,children:[(0,i.jsx)(a(),{block:"um-block/um-account",attributes:e}),(0,i.jsx)(o.InspectorControls,{children:(0,i.jsx)(c.PanelBody,{title:wp.i18n.__("Account Tab","ultimate-member"),children:(0,i.jsx)(c.SelectControl,{label:wp.i18n.__("Select Tab","ultimate-member"),className:"um_select_account_tab",value:r,options:l,style:{height:"35px",lineHeight:"20px",padding:"0 7px"},onChange:d})})})]})},save:()=>null}),jQuery(window).on("load",(function(t){new MutationObserver((function(t){t.forEach((function(t){jQuery(t.addedNodes).find(".um.um-account").each((function(){let t=jQuery(this).find(".um-account-main").attr("data-current_tab"),e=document.querySelector(".um-form");t&&(jQuery(this).find('.um-account-tab[data-tab="'+t+'"]').show(),jQuery(this).find(".um-account-tab:not(:visible)").find("input, select, textarea").not(":disabled").addClass("um_account_inactive").prop("disabled",!0).attr("disabled",!0),um_responsive()),e&&e.addEventListener("click",(t=>{t.target!==e&&(t.preventDefault(),t.stopPropagation())}))}))}))})).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}))})();
|
||||
@@ -10,6 +10,6 @@
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./build/index.js",
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-server-side-render'), 'version' => '9dc130f3a0af7db5d679');
|
||||
@@ -1 +0,0 @@
|
||||
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.element,r=window.wp.data,n=window.wp.components,l=window.wp.blockEditor,o=window.wp.serverSideRender;var i=e.n(o);(0,window.wp.blocks.registerBlockType)("um-block/um-forms",{edit:function(e){let{form_id:o,setAttributes:a}=e.attributes;const s=(0,l.useBlockProps)(),m=(0,r.useSelect)((e=>e("core").getEntityRecords("postType","um_form",{per_page:-1,_fields:["id","title"]})));if(!m)return(0,t.createElement)("p",null,(0,t.createElement)(n.Spinner,null),wp.i18n.__("Loading...","ultimate-member"));if(0===m.length)return"No forms found.";let c=[{id:"",title:""}].concat(m).map((e=>({label:e.title.rendered,value:e.id})));return(0,t.createElement)("div",s,(0,t.createElement)(i(),{block:"um-block/um-forms",attributes:e.attributes}),(0,t.createElement)(l.InspectorControls,null,(0,t.createElement)(n.PanelBody,{title:wp.i18n.__("Select Forms","ultimate-member")},(0,t.createElement)(n.SelectControl,{label:wp.i18n.__("Select Forms","ultimate-member"),className:"um_select_forms",value:o,options:c,style:{height:"35px",lineHeight:"20px",padding:"0 7px"},onChange:t=>{e.setAttributes({form_id:t})}}))))},save:function(e){return null}})})();
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-server-side-render'), 'version' => 'cf4974d44ac78244494c');
|
||||
@@ -1,91 +1 @@
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { PanelBody, SelectControl, Spinner } from '@wordpress/components';
|
||||
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { registerBlockType } from "@wordpress/blocks";
|
||||
|
||||
registerBlockType('um-block/um-forms', {
|
||||
edit: function (props) {
|
||||
let { form_id, setAttributes } = props.attributes;
|
||||
const blockProps = useBlockProps();
|
||||
const posts = useSelect((select) => {
|
||||
return select('core').getEntityRecords('postType', 'um_form', {
|
||||
per_page: -1,
|
||||
_fields: ['id', 'title']
|
||||
});
|
||||
});
|
||||
|
||||
if (!posts) {
|
||||
return (
|
||||
<p>
|
||||
<Spinner />
|
||||
{wp.i18n.__('Loading...', 'ultimate-member')}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
if (posts.length === 0) {
|
||||
return 'No forms found.';
|
||||
}
|
||||
|
||||
function get_option( posts ) {
|
||||
var option = [];
|
||||
|
||||
posts.map( function( post ) {
|
||||
option.push(
|
||||
{
|
||||
label: post.title.rendered,
|
||||
value: post.id
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
function umShortcode( value ) {
|
||||
|
||||
var shortcode = '';
|
||||
|
||||
if (value !== undefined && value !== '') {
|
||||
shortcode = '[ultimatemember form_id="' + value + '"]';
|
||||
}
|
||||
|
||||
return shortcode;
|
||||
}
|
||||
|
||||
let posts_data = [{ id: '', title: '' }].concat(posts);
|
||||
|
||||
let get_post = posts_data.map((post) => {
|
||||
return {
|
||||
label: post.title.rendered,
|
||||
value: post.id
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-forms" attributes={props.attributes} />
|
||||
<InspectorControls>
|
||||
<PanelBody title={wp.i18n.__('Select Forms', 'ultimate-member')}>
|
||||
<SelectControl
|
||||
label={wp.i18n.__('Select Forms', 'ultimate-member')}
|
||||
className="um_select_forms"
|
||||
value={form_id}
|
||||
options={get_post}
|
||||
style={{ height: '35px', lineHeight: '20px', padding: '0 7px' }}
|
||||
onChange={(value) => {
|
||||
props.setAttributes({ form_id: value });
|
||||
umShortcode(value);
|
||||
}}
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
save: function save(props) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var r in o)e.o(o,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:o[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.data,o=window.wp.components,r=window.wp.blockEditor,n=window.wp.serverSideRender;var l=e.n(n);const i=window.wp.blocks,a=window.wp.element,s=window.ReactJSXRuntime;(0,i.registerBlockType)("um-block/um-forms",{edit:function(e){const n=(0,r.useBlockProps)(),{attributes:i,setAttributes:u}=e,{form_id:c}=i,d=(0,t.useSelect)((e=>e("core").getEntityRecords("postType","um_form",{per_page:-1,_fields:["id","title"]})),[]),m=(0,a.useMemo)((()=>d?0===d.length?[{label:wp.i18n.__("No forms found.","ultimate-member"),value:""}]:[{label:wp.i18n.__("Select Form","ultimate-member"),value:""}].concat(d.map((e=>({label:e.title.rendered,value:e.id})))):[{label:wp.i18n.__("Loading...","ultimate-member"),value:""}]),[d]);return(0,s.jsxs)("div",{...n,children:[(0,s.jsx)(l(),{block:"um-block/um-forms",attributes:i}),(0,s.jsx)(r.InspectorControls,{children:(0,s.jsx)(o.PanelBody,{title:wp.i18n.__("Select Forms","ultimate-member"),children:(0,s.jsx)(o.SelectControl,{label:wp.i18n.__("Select Forms","ultimate-member"),className:"um_select_forms",value:c,options:m,onChange:e=>u({form_id:e})})})})]})},save:()=>null}),jQuery(window).on("load",(function(e){new MutationObserver((function(e){e.forEach((function(e){jQuery(e.addedNodes).find(".um-form").each((function(){let e=document.querySelector(".um-form");e&&e.addEventListener("click",(t=>{t.target!==e&&(t.preventDefault(),t.stopPropagation())}))}))}))})).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}))})();
|
||||
@@ -10,6 +10,6 @@
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"editorScript": "file:./build/index.js",
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-server-side-render'), 'version' => '5b1a8ec016836a5c26cd');
|
||||
@@ -1 +0,0 @@
|
||||
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.React,r=window.wp.data,i=window.wp.components,n=window.wp.blockEditor,o=window.wp.serverSideRender;var l=e.n(o);(0,window.wp.blocks.registerBlockType)("um-block/um-member-directories",{edit:function(e){let{member_id:o,setAttributes:a}=e.attributes;const c=(0,n.useBlockProps)(),u=(0,r.useSelect)((e=>e("core").getEntityRecords("postType","um_directory",{per_page:-1,_fields:["id","title"]})));if(!u)return(0,t.createElement)("p",null,(0,t.createElement)(i.Spinner,null),wp.i18n.__("Loading...","ultimate-member"));if(0===u.length)return"No posts found.";let d=[{id:"",title:""}].concat(u).map((e=>({label:e.title.rendered,value:e.id})));return(0,t.createElement)("div",{...c},(0,t.createElement)(l(),{block:"um-block/um-member-directories",attributes:e.attributes}),(0,t.createElement)(n.InspectorControls,null,(0,t.createElement)(i.PanelBody,{title:wp.i18n.__("Select Directories","ultimate-member")},(0,t.createElement)(i.SelectControl,{label:wp.i18n.__("Select Directories","ultimate-member"),className:"um_select_directory",value:o,options:d,style:{height:"35px",lineHeight:"20px",padding:"0 7px"},onChange:t=>{e.setAttributes({member_id:t})}}))))},save:function(e){return null}}),jQuery(window).on("load",(function(e){new MutationObserver((function(e){e.forEach((function(e){jQuery(e.addedNodes).find(".um.um-directory").each((function(){var e=jQuery(this);um_ajax_get_members(e),um_slider_filter_init(e),um_datepicker_filter_init(e),um_timepicker_filter_init(e)})),jQuery(e.addedNodes).find(".um-member").each((function(){var e=jQuery(this).parent();UM_Member_Grid(e)}))}))})).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}))})();
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-server-side-render'), 'version' => 'cced871823424b7be338');
|
||||
@@ -1,112 +1 @@
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { PanelBody, SelectControl, Spinner } from '@wordpress/components';
|
||||
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { registerBlockType } from "@wordpress/blocks";
|
||||
|
||||
registerBlockType('um-block/um-member-directories', {
|
||||
edit: function (props) {
|
||||
let { member_id, setAttributes } = props.attributes;
|
||||
const blockProps = useBlockProps();
|
||||
const posts = useSelect((select) => {
|
||||
return select('core').getEntityRecords('postType', 'um_directory', {
|
||||
per_page: -1,
|
||||
_fields: ['id', 'title']
|
||||
});
|
||||
});
|
||||
|
||||
if (!posts) {
|
||||
return (
|
||||
<p>
|
||||
<Spinner />
|
||||
{wp.i18n.__('Loading...', 'ultimate-member')}
|
||||
</p>
|
||||
);
|
||||
}
|
||||
|
||||
if (posts.length === 0) {
|
||||
return 'No posts found.';
|
||||
}
|
||||
|
||||
function get_option( posts ) {
|
||||
var option = [];
|
||||
|
||||
posts.map( function( post ) {
|
||||
option.push(
|
||||
{
|
||||
label: post.title.rendered,
|
||||
value: post.id
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
return option;
|
||||
}
|
||||
|
||||
function umShortcode( value ) {
|
||||
|
||||
var shortcode = '';
|
||||
|
||||
if (value !== undefined && value !== '') {
|
||||
shortcode = '[ultimatemember form_id="' + value + '"]';
|
||||
}
|
||||
|
||||
return shortcode;
|
||||
}
|
||||
|
||||
let posts_data = [{ id: '', title: '' }].concat(posts);
|
||||
|
||||
let get_post = posts_data.map((post) => {
|
||||
return {
|
||||
label: post.title.rendered,
|
||||
value: post.id
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-member-directories" attributes={props.attributes} />
|
||||
<InspectorControls>
|
||||
<PanelBody title={wp.i18n.__('Select Directories', 'ultimate-member')}>
|
||||
<SelectControl
|
||||
label={wp.i18n.__('Select Directories', 'ultimate-member')}
|
||||
className="um_select_directory"
|
||||
value={member_id}
|
||||
options={get_post}
|
||||
style={{ height: '35px', lineHeight: '20px', padding: '0 7px' }}
|
||||
onChange={(value) => {
|
||||
props.setAttributes({ member_id: value });
|
||||
umShortcode(value);
|
||||
}}
|
||||
/>
|
||||
</PanelBody>
|
||||
</InspectorControls>
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
save: function save(props) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery(window).on( 'load', function($) {
|
||||
var observer = new MutationObserver(function(mutations) {
|
||||
mutations.forEach(function(mutation) {
|
||||
|
||||
jQuery(mutation.addedNodes).find('.um.um-directory').each(function() {
|
||||
var directory = jQuery(this);
|
||||
um_ajax_get_members( directory );
|
||||
um_slider_filter_init( directory );
|
||||
um_datepicker_filter_init( directory );
|
||||
um_timepicker_filter_init( directory );
|
||||
});
|
||||
jQuery(mutation.addedNodes).find('.um-member').each(function() {
|
||||
var directory = jQuery(this).parent();
|
||||
UM_Member_Grid(directory);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});
|
||||
});
|
||||
(()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const t=window.wp.data,r=window.wp.components,i=window.wp.blockEditor,n=window.wp.serverSideRender;var o=e.n(n);const l=window.wp.blocks,a=window.wp.element,c=window.ReactJSXRuntime;(0,l.registerBlockType)("um-block/um-member-directories",{edit:function(e){const n=(0,i.useBlockProps)(),{attributes:l,setAttributes:d}=e,{member_id:u}=l,m=(0,t.useSelect)((e=>e("core").getEntityRecords("postType","um_directory",{per_page:-1,_fields:["id","title"]})),[]),s=(0,a.useMemo)((()=>m?0===m.length?[{label:wp.i18n.__("No posts found.","ultimate-member"),value:""}]:[{label:wp.i18n.__("Select Directory","ultimate-member"),value:""}].concat(m.map((e=>({label:e.title.rendered,value:e.id})))):[{label:wp.i18n.__("Loading...","ultimate-member"),value:""}]),[m]);return m?(0,c.jsxs)("div",{...n,children:[(0,c.jsx)(o(),{block:"um-block/um-member-directories",attributes:l}),(0,c.jsx)(i.InspectorControls,{children:(0,c.jsx)(r.PanelBody,{title:wp.i18n.__("Select Directories","ultimate-member"),children:(0,c.jsx)(r.SelectControl,{label:wp.i18n.__("Select Directories","ultimate-member"),className:"um_select_directory",value:u,options:s,onChange:e=>d({member_id:e})})})})]}):(0,c.jsxs)("p",{children:[(0,c.jsx)(r.Spinner,{}),wp.i18n.__("Loading...","ultimate-member")]})},save:()=>null}),jQuery(window).on("load",(function(e){new MutationObserver((function(e){e.forEach((function(e){jQuery(e.addedNodes).find(".um.um-directory").each((function(){let e=document.querySelector(".um-directory"),t=jQuery(this);um_ajax_get_members(t),um_slider_filter_init(t),um_datepicker_filter_init(t),um_timepicker_filter_init(t),e&&e.addEventListener("click",(t=>{t.target!==e&&(t.preventDefault(),t.stopPropagation())}))})),jQuery(e.addedNodes).find(".um-member").each((function(){let e=document.querySelector(".um-member"),t=jQuery(this).parent();UM_Member_Grid(t),e&&e.addEventListener("click",(t=>{t.target!==e&&(t.preventDefault(),t.stopPropagation())}))}))}))})).observe(document,{attributes:!1,childList:!0,characterData:!1,subtree:!0})}))})();
|
||||
@@ -5,6 +5,6 @@
|
||||
"description": "Displaying the password reset form",
|
||||
"icon": "unlock",
|
||||
"category": "um-blocks",
|
||||
"editorScript": "file:./build/index.js",
|
||||
"editorScript": "file:./src/index.js",
|
||||
"textdomain": "ultimate-member"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-server-side-render'), 'version' => '95e8fe2695e681505871');
|
||||
@@ -1 +0,0 @@
|
||||
(()=>{"use strict";var e={n:r=>{var o=r&&r.__esModule?()=>r.default:()=>r;return e.d(o,{a:o}),o},d:(r,o)=>{for(var t in o)e.o(o,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:o[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=window.wp.element,o=window.wp.blocks,t=window.wp.serverSideRender;var n=e.n(t);const s=window.wp.blockEditor;(0,o.registerBlockType)("um-block/um-password-reset",{edit:function(e){const o=(0,s.useBlockProps)();return(0,r.createElement)("div",o,(0,r.createElement)(n(),{block:"um-block/um-password-reset"}))},save:function(e){return null}})})();
|
||||
@@ -0,0 +1 @@
|
||||
<?php return array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-server-side-render'), 'version' => 'd1e8ad89d47a20d3414b');
|
||||
@@ -1,19 +1 @@
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import ServerSideRender from '@wordpress/server-side-render';
|
||||
import { useBlockProps } from '@wordpress/block-editor';
|
||||
|
||||
registerBlockType('um-block/um-password-reset', {
|
||||
edit: function (props) {
|
||||
const blockProps = useBlockProps();
|
||||
|
||||
return (
|
||||
<div {...blockProps}>
|
||||
<ServerSideRender block="um-block/um-password-reset" />
|
||||
</div>
|
||||
);
|
||||
|
||||
},
|
||||
save: function save(props) {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
(()=>{"use strict";var e={n:o=>{var r=o&&o.__esModule?()=>o.default:()=>o;return e.d(r,{a:r}),r},d:(o,r)=>{for(var t in r)e.o(r,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o)};const o=window.wp.blocks,r=window.wp.serverSideRender;var t=e.n(r);const n=window.wp.blockEditor,s=window.ReactJSXRuntime;(0,o.registerBlockType)("um-block/um-password-reset",{edit:function(){const e=(0,n.useBlockProps)();return(0,s.jsx)("div",{...e,children:(0,s.jsx)(t(),{block:"um-block/um-password-reset"})})},save:()=>null})})();
|
||||
@@ -732,6 +732,7 @@ if ( ! class_exists( 'um\Config' ) ) {
|
||||
'secure_notify_admins_banned_accounts__interval' => 'instant',
|
||||
'secure_allowed_redirect_hosts' => '',
|
||||
'delete_comments' => false,
|
||||
'enable_action_scheduler' => false,
|
||||
);
|
||||
|
||||
add_filter( 'um_get_tabs_from_config', '__return_true' );
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
@@ -502,7 +503,10 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
*/
|
||||
public function includes() {
|
||||
|
||||
$this->maybe_action_scheduler();
|
||||
|
||||
$this->common()->includes();
|
||||
|
||||
$this->access();
|
||||
|
||||
if ( $this->is_request( 'ajax' ) ) {
|
||||
@@ -1439,6 +1443,19 @@ if ( ! class_exists( 'UM' ) ) {
|
||||
return $this->classes['multisite'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Maybe include and init Action Scheduler.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @return um\action_scheduler\Init
|
||||
*/
|
||||
public function maybe_action_scheduler() {
|
||||
if ( empty( $this->classes['action_scheduler'] ) ) {
|
||||
$this->classes['action_scheduler'] = new um\action_scheduler\Init();
|
||||
}
|
||||
return $this->classes['action_scheduler'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Include files with hooked filters/actions
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace um\common\actions;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'um\common\actions\Emails' ) ) {
|
||||
|
||||
/**
|
||||
* Class Emails
|
||||
*
|
||||
* @since 2.9.0
|
||||
*
|
||||
* @package um\common\actions
|
||||
*/
|
||||
class Emails {
|
||||
|
||||
public function __construct() {
|
||||
add_action( 'um_dispatch_email', array( $this, 'send' ), 10, 3 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Send an email
|
||||
*
|
||||
* @param string $user_email User email.
|
||||
* @param string $template Template name.
|
||||
* @param array $args Email additional arguments.
|
||||
*/
|
||||
public function send( $user_email, $template, $args = array() ) {
|
||||
if ( empty( $user_email ) && empty( $template ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
UM()->mail()->send( $user_email, $template, $args );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ if ( ! class_exists( 'um\common\Init' ) ) {
|
||||
* @used-by \UM::includes()
|
||||
*/
|
||||
public function includes() {
|
||||
$this->actions();
|
||||
|
||||
$this->cpt()->hooks();
|
||||
$this->screen();
|
||||
$this->secure()->hooks();
|
||||
@@ -28,6 +30,18 @@ if ( ! class_exists( 'um\common\Init' ) ) {
|
||||
$this->users()->hooks();
|
||||
}
|
||||
|
||||
/**
|
||||
* Init actions that can be scheduled via Action Scheduler.
|
||||
*
|
||||
* @since 2.9.0
|
||||
*/
|
||||
private function actions() {
|
||||
if ( empty( UM()->classes['um\common\actions\emails'] ) ) {
|
||||
UM()->classes['um\common\actions\emails'] = new actions\Emails();
|
||||
}
|
||||
// Other classes init here as soon as possible.
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.6.8
|
||||
*
|
||||
|
||||
@@ -113,16 +113,19 @@ if ( ! class_exists( 'um\common\Secure' ) ) {
|
||||
$emails = um_multi_admin_email();
|
||||
if ( ! empty( $emails ) ) {
|
||||
foreach ( $emails as $email ) {
|
||||
UM()->mail()->send(
|
||||
$email,
|
||||
'suspicious-activity',
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action(
|
||||
'um_dispatch_email',
|
||||
array(
|
||||
'admin' => true,
|
||||
'tags' => array(
|
||||
'{banned_profile_links}',
|
||||
),
|
||||
'tags_replace' => array(
|
||||
$banned_profile_links,
|
||||
$email,
|
||||
'suspicious-activity',
|
||||
array(
|
||||
'admin' => true,
|
||||
'tags' => array(
|
||||
'{banned_profile_links}',
|
||||
),
|
||||
'tags_replace' => array(
|
||||
$banned_profile_links,
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
@@ -388,7 +388,7 @@ class Users {
|
||||
add_filter( 'um_template_tags_patterns_hook', array( UM()->user(), 'add_activation_placeholder' ) );
|
||||
add_filter( 'um_template_tags_replaces_hook', array( UM()->user(), 'add_activation_replace_placeholder' ) );
|
||||
|
||||
UM()->mail()->send( $userdata->user_email, 'checkmail_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, 'checkmail_email' ) );
|
||||
|
||||
um_fetch_user( $current_user_id );
|
||||
/**
|
||||
@@ -456,7 +456,7 @@ class Users {
|
||||
$this->reset_activation_link( $user_id );
|
||||
|
||||
$userdata = get_userdata( $user_id );
|
||||
UM()->mail()->send( $userdata->user_email, 'inactive_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, 'inactive_email' ) );
|
||||
|
||||
/**
|
||||
* Fires after User has been deactivated.
|
||||
@@ -528,7 +528,7 @@ class Users {
|
||||
$this->reset_activation_link( $user_id );
|
||||
|
||||
$userdata = get_userdata( $user_id );
|
||||
UM()->mail()->send( $userdata->user_email, 'rejected_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, 'rejected_email' ) );
|
||||
|
||||
/**
|
||||
* Fires after User has been rejected.
|
||||
@@ -606,7 +606,7 @@ class Users {
|
||||
$this->reset_activation_link( $user_id );
|
||||
|
||||
$userdata = get_userdata( $user_id );
|
||||
UM()->mail()->send( $userdata->user_email, 'pending_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, 'pending_email' ) );
|
||||
|
||||
/**
|
||||
* Fires after User has been set as pending admin review.
|
||||
@@ -697,7 +697,7 @@ class Users {
|
||||
add_filter( 'um_template_tags_patterns_hook', array( UM()->password(), 'add_placeholder' ) );
|
||||
add_filter( 'um_template_tags_replaces_hook', array( UM()->password(), 'add_replace_placeholder' ) );
|
||||
|
||||
UM()->mail()->send( $userdata->user_email, $email_slug );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, $email_slug ) );
|
||||
|
||||
um_fetch_user( $current_user_id );
|
||||
/**
|
||||
@@ -774,7 +774,7 @@ class Users {
|
||||
add_filter( 'um_template_tags_patterns_hook', array( UM()->password(), 'add_placeholder' ) );
|
||||
add_filter( 'um_template_tags_replaces_hook', array( UM()->password(), 'add_replace_placeholder' ) );
|
||||
|
||||
UM()->mail()->send( $userdata->user_email, 'welcome_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, 'welcome_email' ) );
|
||||
|
||||
um_fetch_user( $current_user_id );
|
||||
|
||||
|
||||
@@ -49,13 +49,13 @@ if ( ! class_exists( 'um\core\AJAX_Common' ) ) {
|
||||
add_action( 'wp_ajax_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) );
|
||||
add_action( 'wp_ajax_nopriv_um_remove_file', array( UM()->files(), 'ajax_remove_file' ) );
|
||||
|
||||
add_action( 'wp_ajax_nopriv_um_fileupload', array( UM()->files(), 'ajax_file_upload' ) );
|
||||
add_action( 'wp_ajax_nopriv_um_fileupload', array( UM()->files(), 'ajax_file_upload' ) ); // Enabled files uploading on registration form.
|
||||
add_action( 'wp_ajax_um_fileupload', array( UM()->files(), 'ajax_file_upload' ) );
|
||||
|
||||
add_action( 'wp_ajax_nopriv_um_imageupload', array( UM()->files(), 'ajax_image_upload' ) );
|
||||
add_action( 'wp_ajax_nopriv_um_imageupload', array( UM()->files(), 'ajax_image_upload' ) ); // Enabled image uploading on registration form.
|
||||
add_action( 'wp_ajax_um_imageupload', array( UM()->files(), 'ajax_image_upload' ) );
|
||||
|
||||
add_action( 'wp_ajax_nopriv_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
|
||||
add_action( 'wp_ajax_nopriv_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) ); // Enabled image resize on registration form.
|
||||
add_action( 'wp_ajax_um_resize_image', array( UM()->files(), 'ajax_resize_image' ) );
|
||||
|
||||
add_action( 'wp_ajax_nopriv_um_get_members', array( UM()->member_directory(), 'ajax_get_members' ) );
|
||||
|
||||
@@ -17,7 +17,7 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
|
||||
* Blocks constructor.
|
||||
*/
|
||||
public function __construct() {
|
||||
add_action( 'init', array( &$this, 'block_editor_render' ) );
|
||||
add_action( 'init', array( &$this, 'block_editor_render' ), 11 );
|
||||
add_filter( 'block_type_metadata_settings', array( &$this, 'block_type_metadata_settings' ), 9999, 2 );
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
|
||||
* Register UM Blocks.
|
||||
*
|
||||
* @uses register_block_type_from_metadata()
|
||||
* @uses wp_register_block_metadata_collection()
|
||||
*/
|
||||
public function block_editor_render() {
|
||||
/**
|
||||
@@ -99,6 +100,10 @@ if ( ! class_exists( 'um\core\Blocks' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( function_exists( 'wp_register_block_metadata_collection' ) ) {
|
||||
wp_register_block_metadata_collection( UM_PATH . 'includes/blocks', UM_PATH . 'includes/blocks/blocks-manifest.php' );
|
||||
}
|
||||
|
||||
$blocks = array(
|
||||
'um-block/um-member-directories' => array(
|
||||
'render_callback' => array( $this, 'member_directories_render' ),
|
||||
|
||||
+321
-104
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
namespace um\core;
|
||||
|
||||
use Exception;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
@@ -322,16 +324,86 @@ if ( ! class_exists( 'um\core\Files' ) ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid coordinates', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$key = sanitize_text_field( $_REQUEST['key'] );
|
||||
$coord = sanitize_text_field( $_REQUEST['coord'] );
|
||||
$user_id = empty( $_REQUEST['user_id'] ) ? get_current_user_id() : absint( $_REQUEST['user_id'] );
|
||||
$user_id = empty( $_REQUEST['user_id'] ) ? null : absint( $_REQUEST['user_id'] );
|
||||
if ( $user_id && is_user_logged_in() && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
wp_send_json_error( esc_js( __( 'You have no permission to edit this user', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
UM()->fields()->set_id = isset( $_POST['set_id'] ) ? absint( $_POST['set_id'] ) : null;
|
||||
UM()->fields()->set_mode = isset( $_POST['set_mode'] ) ? sanitize_text_field( $_POST['set_mode'] ) : null;
|
||||
if ( $user_id && ! is_user_logged_in() ) {
|
||||
wp_send_json_error( esc_js( __( 'Please login to edit this user', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
if ( 'register' !== UM()->fields()->set_mode && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
$ret['error'] = esc_js( __( 'You have no permission to edit this user', 'ultimate-member' ) );
|
||||
wp_send_json_error( $ret );
|
||||
$form_id = isset( $_POST['set_id'] ) ? absint( $_POST['set_id'] ) : null;
|
||||
$mode = isset( $_POST['set_mode'] ) ? sanitize_text_field( $_POST['set_mode'] ) : null;
|
||||
|
||||
UM()->fields()->set_id = $form_id;
|
||||
UM()->fields()->set_mode = $mode;
|
||||
|
||||
if ( ! is_user_logged_in() && 'profile' === $mode ) {
|
||||
wp_send_json_error( esc_js( __( 'You have no permission to edit user profile', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
if ( null !== $user_id && 'register' === $mode ) {
|
||||
wp_send_json_error( esc_js( __( 'User has to be empty on registration', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$form_post = get_post( $form_id );
|
||||
// Invalid post ID. Maybe post doesn't exist.
|
||||
if ( empty( $form_post ) ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid form ID', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
if ( 'um_form' !== $form_post->post_type ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid form post type', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$form_status = get_post_status( $form_id );
|
||||
if ( 'publish' !== $form_status ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid form status', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$post_data = UM()->query()->post_data( $form_id );
|
||||
if ( ! array_key_exists( 'mode', $post_data ) || $mode !== $post_data['mode'] ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid form type', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
// For profiles only.
|
||||
if ( 'profile' === $mode && ! empty( $post_data['use_custom_settings'] ) && ! empty( $post_data['role'] ) ) {
|
||||
// Option "Apply custom settings to this form". Option "Make this profile form role-specific".
|
||||
// Show the first Profile Form with role selected, don't show profile forms below the page with other role-specific setting.
|
||||
$current_user_roles = UM()->roles()->get_all_user_roles( $user_id );
|
||||
if ( empty( $current_user_roles ) ) {
|
||||
wp_send_json_error( esc_js( __( 'You have no permission to edit this user through this form', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
if ( is_array( $post_data['role'] ) ) {
|
||||
if ( ! count( array_intersect( $post_data['role'], $current_user_roles ) ) ) {
|
||||
wp_send_json_error( esc_js( __( 'You have no permission to edit this user through this form', 'ultimate-member' ) ) );
|
||||
}
|
||||
} elseif ( ! in_array( $post_data['role'], $current_user_roles, true ) ) {
|
||||
wp_send_json_error( esc_js( __( 'You have no permission to edit this user through this form', 'ultimate-member' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
$key = sanitize_text_field( $_REQUEST['key'] );
|
||||
|
||||
if ( ! array_key_exists( 'custom_fields', $post_data ) || empty( $post_data['custom_fields'] ) ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid form fields', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$custom_fields = maybe_unserialize( $post_data['custom_fields'] );
|
||||
if ( ! is_array( $custom_fields ) || ! array_key_exists( $key, $custom_fields ) ) {
|
||||
if ( ! ( 'profile' === $mode && in_array( $key, array( 'cover_photo', 'profile_photo' ), true ) ) ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid field metakey', 'ultimate-member' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( empty( $custom_fields[ $key ]['crop'] ) && ! in_array( $key, array( 'cover_photo', 'profile_photo' ), true ) ) {
|
||||
wp_send_json_error( esc_js( __( 'This field doesn\'t support image crop', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
if ( 'profile' === $mode && ! um_can_edit_field( $custom_fields[ $key ] ) ) {
|
||||
wp_send_json_error( esc_js( __( 'You have no permission to edit this field', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$src = esc_url_raw( $_REQUEST['src'] );
|
||||
@@ -340,6 +412,8 @@ if ( ! class_exists( 'um\core\Files' ) ) {
|
||||
wp_send_json_error( esc_js( __( 'Invalid file ownership', 'ultimate-member' ) ) );
|
||||
}
|
||||
|
||||
$coord = sanitize_text_field( $_REQUEST['coord'] );
|
||||
|
||||
UM()->uploader()->replace_upload_dir = true;
|
||||
|
||||
$output = UM()->uploader()->resize_image( $image_path, $src, $key, $user_id, $coord );
|
||||
@@ -354,166 +428,309 @@ if ( ! class_exists( 'um\core\Files' ) ) {
|
||||
/**
|
||||
* Image upload by AJAX
|
||||
*
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
function ajax_image_upload() {
|
||||
public function ajax_image_upload() {
|
||||
$ret['error'] = null;
|
||||
$ret = array();
|
||||
|
||||
$id = sanitize_text_field( $_POST['key'] );
|
||||
$timestamp = absint( $_POST['timestamp'] );
|
||||
$nonce = sanitize_text_field( $_POST['_wpnonce'] );
|
||||
$user_id = empty( $_POST['user_id'] ) ? get_current_user_id() : absint( $_POST['user_id'] );
|
||||
|
||||
UM()->fields()->set_id = absint( $_POST['set_id'] );
|
||||
UM()->fields()->set_mode = sanitize_key( $_POST['set_mode'] );
|
||||
|
||||
if ( UM()->fields()->set_mode != 'register' && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
$ret['error'] = __( 'You have no permission to edit this user', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
$ret = array();
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
* Filters image upload checking nonce.
|
||||
*
|
||||
* @type filter
|
||||
* @title um_image_upload_nonce
|
||||
* @description Change Image Upload nonce
|
||||
* @input_vars
|
||||
* [{"var":"$nonce","type":"bool","desc":"Nonce"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage
|
||||
* <?php add_filter( 'um_image_upload_nonce', 'function_name', 10, 1 ); ?>
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_image_upload_nonce', 'my_image_upload_nonce', 10, 1 );
|
||||
* function my_image_upload_nonce( $nonce ) {
|
||||
* @param {bool} $verify_nonce Verify nonce marker. Default true.
|
||||
*
|
||||
* @return {bool} Verify nonce marker.
|
||||
*
|
||||
* @since 1.3.x
|
||||
* @hook um_image_upload_nonce
|
||||
*
|
||||
* @example <caption>Disable checking nonce on image upload.</caption>
|
||||
* function my_image_upload_nonce( $verify_nonce ) {
|
||||
* // your code here
|
||||
* return $nonce;
|
||||
* $verify_nonce = false;
|
||||
* return $verify_nonce;
|
||||
* }
|
||||
* ?>
|
||||
* add_filter( 'um_image_upload_nonce', 'my_image_upload_nonce' );
|
||||
*/
|
||||
$um_image_upload_nonce = apply_filters( 'um_image_upload_nonce', true );
|
||||
|
||||
if ( $um_image_upload_nonce ) {
|
||||
$timestamp = absint( $_POST['timestamp'] );
|
||||
$nonce = sanitize_text_field( $_POST['_wpnonce'] );
|
||||
if ( ! wp_verify_nonce( $nonce, "um_upload_nonce-{$timestamp}" ) && is_user_logged_in() ) {
|
||||
// This nonce is not valid.
|
||||
$ret['error'] = __( 'Invalid nonce', 'ultimate-member' );
|
||||
$ret['error'] = esc_html__( 'Invalid nonce', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
}
|
||||
|
||||
$user_id = empty( $_POST['user_id'] ) ? null : absint( $_POST['user_id'] );
|
||||
if ( $user_id && is_user_logged_in() && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( $user_id && ! is_user_logged_in() ) {
|
||||
$ret['error'] = esc_html__( 'Please login to edit this user', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$form_id = absint( $_POST['set_id'] );
|
||||
$mode = sanitize_key( $_POST['set_mode'] );
|
||||
|
||||
UM()->fields()->set_id = $form_id;
|
||||
UM()->fields()->set_mode = $mode;
|
||||
|
||||
if ( ! is_user_logged_in() && 'profile' === $mode ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit user profile', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( null !== $user_id && 'register' === $mode ) {
|
||||
$ret['error'] = esc_html__( 'User has to be empty on registration', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$form_post = get_post( $form_id );
|
||||
// Invalid post ID. Maybe post doesn't exist.
|
||||
if ( empty( $form_post ) ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form ID', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( 'um_form' !== $form_post->post_type ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form post type', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$form_status = get_post_status( $form_id );
|
||||
if ( 'publish' !== $form_status ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form status', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$post_data = UM()->query()->post_data( $form_id );
|
||||
if ( ! array_key_exists( 'mode', $post_data ) || $mode !== $post_data['mode'] ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form type', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
// For profiles only.
|
||||
if ( 'profile' === $mode && ! empty( $post_data['use_custom_settings'] ) && ! empty( $post_data['role'] ) ) {
|
||||
// Option "Apply custom settings to this form". Option "Make this profile form role-specific".
|
||||
// Show the first Profile Form with role selected, don't show profile forms below the page with other role-specific setting.
|
||||
$current_user_roles = UM()->roles()->get_all_user_roles( $user_id );
|
||||
if ( empty( $current_user_roles ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user through this form', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( is_array( $post_data['role'] ) ) {
|
||||
if ( ! count( array_intersect( $post_data['role'], $current_user_roles ) ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user through this form', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
} elseif ( ! in_array( $post_data['role'], $current_user_roles, true ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user through this form', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
}
|
||||
|
||||
$id = sanitize_text_field( $_POST['key'] );
|
||||
|
||||
if ( ! array_key_exists( 'custom_fields', $post_data ) || empty( $post_data['custom_fields'] ) ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form fields', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$custom_fields = maybe_unserialize( $post_data['custom_fields'] );
|
||||
if ( ! is_array( $custom_fields ) || ! array_key_exists( $id, $custom_fields ) ) {
|
||||
if ( ! ( 'profile' === $mode && in_array( $id, array( 'cover_photo', 'profile_photo' ), true ) ) ) {
|
||||
$ret['error'] = esc_html__( 'Invalid field metakey', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
}
|
||||
|
||||
if ( 'profile' === $mode && ! um_can_edit_field( $custom_fields[ $id ] ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this field', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( isset( $_FILES[ $id ]['name'] ) ) {
|
||||
|
||||
if ( ! is_array( $_FILES[ $id ]['name'] ) ) {
|
||||
|
||||
UM()->uploader()->replace_upload_dir = true;
|
||||
|
||||
$uploaded = UM()->uploader()->upload_image( $_FILES[ $id ], $user_id, $id );
|
||||
|
||||
UM()->uploader()->replace_upload_dir = false;
|
||||
|
||||
if ( isset( $uploaded['error'] ) ) {
|
||||
$ret['error'] = $uploaded['error'];
|
||||
} else {
|
||||
$ret[] = $uploaded['handle_upload'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
$ret['error'] = __( 'A theme or plugin compatibility issue', 'ultimate-member' );
|
||||
$ret['error'] = esc_html__( 'A theme or plugin compatibility issue', 'ultimate-member' );
|
||||
}
|
||||
|
||||
wp_send_json_success( $ret );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* File upload by AJAX
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
function ajax_file_upload() {
|
||||
public function ajax_file_upload() {
|
||||
$ret['error'] = null;
|
||||
$ret = array();
|
||||
|
||||
/* commented for enable download files on registration form
|
||||
* if ( ! is_user_logged_in() ) {
|
||||
$ret['error'] = 'Invalid user';
|
||||
die( json_encode( $ret ) );
|
||||
}*/
|
||||
|
||||
$nonce = sanitize_text_field( $_POST['_wpnonce'] );
|
||||
$id = sanitize_text_field( $_POST['key'] );
|
||||
$timestamp = absint( $_POST['timestamp'] );
|
||||
|
||||
UM()->fields()->set_id = absint( $_POST['set_id'] );
|
||||
UM()->fields()->set_mode = sanitize_key( $_POST['set_mode'] );
|
||||
$ret = array();
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
* Filters file upload checking nonce.
|
||||
*
|
||||
* @type filter
|
||||
* @title um_file_upload_nonce
|
||||
* @description Change File Upload nonce
|
||||
* @input_vars
|
||||
* [{"var":"$nonce","type":"bool","desc":"Nonce"}]
|
||||
* @change_log
|
||||
* ["Since: 2.0"]
|
||||
* @usage
|
||||
* <?php add_filter( 'um_file_upload_nonce', 'function_name', 10, 1 ); ?>
|
||||
* @example
|
||||
* <?php
|
||||
* add_filter( 'um_file_upload_nonce', 'my_file_upload_nonce', 10, 1 );
|
||||
* function my_file_upload_nonce( $nonce ) {
|
||||
* @param {bool} $verify_nonce Verify nonce marker. Default true.
|
||||
*
|
||||
* @return {bool} Verify nonce marker.
|
||||
*
|
||||
* @since 1.3.x
|
||||
* @hook um_file_upload_nonce
|
||||
*
|
||||
* @example <caption>Disable checking nonce on file upload.</caption>
|
||||
* function my_file_upload_nonce( $verify_nonce ) {
|
||||
* // your code here
|
||||
* return $nonce;
|
||||
* $verify_nonce = false;
|
||||
* return $verify_nonce;
|
||||
* }
|
||||
* ?>
|
||||
* add_filter( 'um_file_upload_nonce', 'my_file_upload_nonce' );
|
||||
*/
|
||||
$um_file_upload_nonce = apply_filters("um_file_upload_nonce", true );
|
||||
$um_file_upload_nonce = apply_filters( 'um_file_upload_nonce', true );
|
||||
if ( $um_file_upload_nonce ) {
|
||||
$nonce = sanitize_text_field( $_POST['_wpnonce'] );
|
||||
$timestamp = absint( $_POST['timestamp'] );
|
||||
|
||||
if ( $um_file_upload_nonce ) {
|
||||
if ( ! wp_verify_nonce( $nonce, 'um_upload_nonce-'.$timestamp ) && is_user_logged_in() ) {
|
||||
if ( ! wp_verify_nonce( $nonce, 'um_upload_nonce-' . $timestamp ) && is_user_logged_in() ) {
|
||||
// This nonce is not valid.
|
||||
$ret['error'] = 'Invalid nonce';
|
||||
$ret['error'] = esc_html__( 'Invalid nonce', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$user_id = empty( $_POST['user_id'] ) ? null : absint( $_POST['user_id'] );
|
||||
if ( $user_id && is_user_logged_in() && ! UM()->roles()->um_current_user_can( 'edit', $user_id ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if( isset( $_FILES[ $id ]['name'] ) ) {
|
||||
if ( $user_id && ! is_user_logged_in() ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( ! is_array( $_FILES[ $id ]['name'] ) ) {
|
||||
$form_id = absint( $_POST['set_id'] );
|
||||
$mode = sanitize_key( $_POST['set_mode'] );
|
||||
|
||||
$user_id = absint( $_POST['user_id'] );
|
||||
UM()->fields()->set_id = $form_id;
|
||||
UM()->fields()->set_mode = $mode;
|
||||
|
||||
UM()->uploader()->replace_upload_dir = true;
|
||||
$uploaded = UM()->uploader()->upload_file( $_FILES[ $id ], $user_id, $id );
|
||||
UM()->uploader()->replace_upload_dir = false;
|
||||
if ( isset( $uploaded['error'] ) ){
|
||||
if ( ! is_user_logged_in() && 'profile' === $mode ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$ret['error'] = $uploaded['error'];
|
||||
if ( null !== $user_id && 'register' === $mode ) {
|
||||
$ret['error'] = esc_html__( 'User has to be empty on registration', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
} else {
|
||||
$form_post = get_post( $form_id );
|
||||
// Invalid post ID. Maybe post doesn't exist.
|
||||
if ( empty( $form_post ) ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form ID', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$uploaded_file = $uploaded['handle_upload'];
|
||||
$ret['url'] = $uploaded_file['file_info']['name'];
|
||||
$ret['icon'] = UM()->files()->get_fonticon_by_ext( $uploaded_file['file_info']['ext'] );
|
||||
$ret['icon_bg'] = UM()->files()->get_fonticon_bg_by_ext( $uploaded_file['file_info']['ext'] );
|
||||
$ret['filename'] = $uploaded_file['file_info']['basename'];
|
||||
$ret['original_name'] = $uploaded_file['file_info']['original_name'];
|
||||
if ( 'um_form' !== $form_post->post_type ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form post type', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$form_status = get_post_status( $form_id );
|
||||
if ( 'publish' !== $form_status ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form status', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$post_data = UM()->query()->post_data( $form_id );
|
||||
if ( ! array_key_exists( 'mode', $post_data ) || $mode !== $post_data['mode'] ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form type', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
// For profiles only.
|
||||
if ( 'profile' === $mode && ! empty( $post_data['use_custom_settings'] ) && ! empty( $post_data['role'] ) ) {
|
||||
// Option "Apply custom settings to this form". Option "Make this profile form role-specific".
|
||||
// Show the first Profile Form with role selected, don't show profile forms below the page with other role-specific setting.
|
||||
$current_user_roles = UM()->roles()->get_all_user_roles( $user_id );
|
||||
if ( empty( $current_user_roles ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user through this form', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( is_array( $post_data['role'] ) ) {
|
||||
if ( ! count( array_intersect( $post_data['role'], $current_user_roles ) ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user through this form', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
} elseif ( ! in_array( $post_data['role'], $current_user_roles, true ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this user through this form', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
} else {
|
||||
$ret['error'] = __('A theme or plugin compatibility issue','ultimate-member');
|
||||
}
|
||||
|
||||
$id = sanitize_text_field( $_POST['key'] );
|
||||
|
||||
if ( ! array_key_exists( 'custom_fields', $post_data ) || empty( $post_data['custom_fields'] ) ) {
|
||||
$ret['error'] = esc_html__( 'Invalid form fields', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
$custom_fields = maybe_unserialize( $post_data['custom_fields'] );
|
||||
if ( ! is_array( $custom_fields ) || ! array_key_exists( $id, $custom_fields ) ) {
|
||||
$ret['error'] = esc_html__( 'Invalid field metakey', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( 'profile' === $mode && ! um_can_edit_field( $custom_fields[ $id ] ) ) {
|
||||
$ret['error'] = esc_html__( 'You have no permission to edit this field', 'ultimate-member' );
|
||||
wp_send_json_error( $ret );
|
||||
}
|
||||
|
||||
if ( isset( $_FILES[ $id ]['name'] ) ) {
|
||||
if ( ! is_array( $_FILES[ $id ]['name'] ) ) {
|
||||
UM()->uploader()->replace_upload_dir = true;
|
||||
|
||||
$uploaded = UM()->uploader()->upload_file( $_FILES[ $id ], $user_id, $id );
|
||||
|
||||
UM()->uploader()->replace_upload_dir = false;
|
||||
|
||||
if ( isset( $uploaded['error'] ) ) {
|
||||
$ret['error'] = $uploaded['error'];
|
||||
} else {
|
||||
$uploaded_file = $uploaded['handle_upload'];
|
||||
$ret['url'] = $uploaded_file['file_info']['name'];
|
||||
$ret['icon'] = UM()->files()->get_fonticon_by_ext( $uploaded_file['file_info']['ext'] );
|
||||
$ret['icon_bg'] = UM()->files()->get_fonticon_bg_by_ext( $uploaded_file['file_info']['ext'] );
|
||||
$ret['filename'] = $uploaded_file['file_info']['basename'];
|
||||
$ret['original_name'] = $uploaded_file['file_info']['original_name'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$ret['error'] = esc_html__( 'A theme or plugin compatibility issue', 'ultimate-member' );
|
||||
}
|
||||
|
||||
wp_send_json_success( $ret );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Allowed image types
|
||||
*
|
||||
|
||||
@@ -818,11 +818,6 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
case 'textarea':
|
||||
if ( ! empty( $field['html'] ) || ( UM()->profile()->get_show_bio_key( $form ) === $k && UM()->options()->get( 'profile_show_html_bio' ) ) ) {
|
||||
$form[ $k ] = html_entity_decode( $form[ $k ] ); // required because WP_Editor send sometimes encoded content.
|
||||
preg_match( '/^<p>(.*?)<\/p>$/', $form[ $k ], $match ); // required because WP_Editor send content wrapped to <p></p>
|
||||
if ( ! empty( $match[1] ) ) {
|
||||
$form[ $k ] = $match[1];
|
||||
}
|
||||
|
||||
$form[ $k ] = self::maybe_apply_tidy( $form[ $k ], $field );
|
||||
|
||||
$allowed_html = UM()->get_allowed_html( 'templates' );
|
||||
@@ -963,11 +958,6 @@ if ( ! class_exists( 'um\core\Form' ) ) {
|
||||
$field_exists = true;
|
||||
if ( ! empty( $custom_fields[ $description_key ]['html'] ) && $bio_html ) {
|
||||
$form[ $description_key ] = html_entity_decode( $form[ $description_key ] ); // required because WP_Editor send sometimes encoded content.
|
||||
preg_match( '/^<p>(.*?)<\/p>$/', $form[ $description_key ], $match ); // required because WP_Editor send content wrapped to <p></p>
|
||||
if ( ! empty( $match[1] ) ) {
|
||||
$form[ $description_key ] = $match[1];
|
||||
}
|
||||
|
||||
$form[ $description_key ] = self::maybe_apply_tidy( $form[ $description_key ], $custom_fields[ $description_key ] );
|
||||
|
||||
$allowed_html = UM()->get_allowed_html( 'templates' );
|
||||
|
||||
@@ -250,7 +250,7 @@ if ( ! class_exists( 'um\core\Plugin_Updater' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
|
||||
$api_params = array(
|
||||
'edd_action' => 'check_licenses',
|
||||
|
||||
@@ -3,6 +3,8 @@ namespace um\core;
|
||||
|
||||
|
||||
// Exit if accessed directly
|
||||
use Exception;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
|
||||
@@ -300,13 +302,13 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
* @since 2.0.22
|
||||
*
|
||||
* @return array
|
||||
* @throws \Exception
|
||||
* @throws Exception
|
||||
*/
|
||||
public function upload_image( $uploadedfile, $user_id = null, $field_key = '', $upload_type = 'stream_photo' ) {
|
||||
$response = array();
|
||||
|
||||
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
}
|
||||
|
||||
if ( empty( $field_key ) ) {
|
||||
@@ -323,7 +325,7 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
$this->user_id = $user_id;
|
||||
}
|
||||
|
||||
if ( in_array( $field_key, array( 'profile_photo', 'cover_photo' ) ) ) {
|
||||
if ( in_array( $field_key, array( 'profile_photo', 'cover_photo' ), true ) ) {
|
||||
$this->upload_image_type = $field_key;
|
||||
}
|
||||
|
||||
@@ -510,19 +512,20 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
/**
|
||||
* Upload Files
|
||||
*
|
||||
* @since 2.0.22
|
||||
*
|
||||
* @param $uploadedfile
|
||||
* @param int|null $user_id
|
||||
* @param string $field_key
|
||||
*
|
||||
* @since 2.0.22
|
||||
*
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function upload_file( $uploadedfile, $user_id = null, $field_key = '' ) {
|
||||
$response = array();
|
||||
|
||||
if ( ! function_exists( 'wp_handle_upload' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/file.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/file.php';
|
||||
}
|
||||
|
||||
$this->field_key = $field_key;
|
||||
@@ -535,19 +538,19 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
|
||||
$field_data = UM()->fields()->get_field( $field_key );
|
||||
|
||||
$field_allowed_file_types = explode(",", $field_data['allowed_types'] );
|
||||
$field_allowed_file_types = explode( ',', $field_data['allowed_types'] );
|
||||
|
||||
$allowed_file_mimes = array();
|
||||
|
||||
foreach ( $field_allowed_file_types as $a ) {
|
||||
$atype = wp_check_filetype( "test.{$a}" );
|
||||
$atype = wp_check_filetype( "test.{$a}" );
|
||||
$allowed_file_mimes[ $atype['ext'] ] = $atype['type'];
|
||||
}
|
||||
|
||||
$upload_overrides = array(
|
||||
'test_form' => false,
|
||||
'mimes' => apply_filters( 'um_uploader_allowed_file_mimes', $allowed_file_mimes ),
|
||||
'unique_filename_callback' => array( $this, 'unique_filename' ),
|
||||
'test_form' => false,
|
||||
'mimes' => apply_filters( 'um_uploader_allowed_file_mimes', $allowed_file_mimes ),
|
||||
'unique_filename_callback' => array( $this, 'unique_filename' ),
|
||||
);
|
||||
|
||||
$upload_overrides = apply_filters( "um_file_upload_handler_overrides__{$field_key}", $upload_overrides );
|
||||
@@ -556,9 +559,9 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
|
||||
if ( isset( $movefile['error'] ) ) {
|
||||
/*
|
||||
* Error generated by _wp_handle_upload()
|
||||
* @see _wp_handle_upload() in wp-admin/includes/file.php
|
||||
*/
|
||||
* Error generated by _wp_handle_upload()
|
||||
* @see _wp_handle_upload() in wp-admin/includes/file.php
|
||||
*/
|
||||
$response['error'] = $movefile['error'];
|
||||
} else {
|
||||
|
||||
@@ -574,7 +577,6 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
$movefile['file_info']['size'] = filesize( $movefile['file'] );
|
||||
$movefile['file_info']['size_format'] = size_format( $movefile['file_info']['size'] );
|
||||
|
||||
|
||||
/**
|
||||
* UM hook
|
||||
*
|
||||
@@ -690,7 +692,7 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
$error = null;
|
||||
|
||||
if ( ! function_exists( 'wp_get_image_editor' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/media.php';
|
||||
}
|
||||
|
||||
$image = wp_get_image_editor( $file );
|
||||
@@ -814,7 +816,7 @@ if ( ! class_exists( 'um\core\Uploader' ) ) {
|
||||
$error = null;
|
||||
|
||||
if ( ! function_exists( 'wp_get_image_editor' ) ) {
|
||||
require_once( ABSPATH . 'wp-admin/includes/media.php' );
|
||||
require_once ABSPATH . 'wp-admin/includes/media.php';
|
||||
}
|
||||
|
||||
$file_type = wp_check_filetype( $file );
|
||||
|
||||
@@ -622,12 +622,15 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
|
||||
// send email notifications
|
||||
if ( $this->send_mail_on_delete ) {
|
||||
UM()->mail()->send( um_user( 'user_email' ), 'deletion_email' );
|
||||
$user_email = um_user( 'user_email' );
|
||||
$template = 'deletion_email';
|
||||
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $user_email, $template ) );
|
||||
|
||||
$emails = um_multi_admin_email();
|
||||
if ( ! empty( $emails ) ) {
|
||||
foreach ( $emails as $email ) {
|
||||
UM()->mail()->send( $email, 'notification_deletion', array( 'admin' => true ) );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $email, 'notification_deletion', array( 'admin' => true ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1517,7 +1520,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
add_filter( 'um_template_tags_patterns_hook', array( UM()->password(), 'add_placeholder' ), 10, 1 );
|
||||
add_filter( 'um_template_tags_replaces_hook', array( UM()->password(), 'add_replace_placeholder' ), 10, 1 );
|
||||
|
||||
UM()->mail()->send( $userdata->user_email, 'resetpw_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $userdata->user_email, 'resetpw_email' ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -1531,7 +1534,7 @@ if ( ! class_exists( 'um\core\User' ) ) {
|
||||
um_fetch_user( $user_id );
|
||||
}
|
||||
|
||||
UM()->mail()->send( um_user( 'user_email' ), 'changedpw_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( um_user( 'user_email' ), 'changedpw_email' ) );
|
||||
|
||||
if ( ! empty( $user_id ) ) {
|
||||
um_reset_user();
|
||||
|
||||
@@ -593,7 +593,7 @@ function um_account_updated_notification( $user_id, $changed ) {
|
||||
if ( 'password' !== $_POST['_um_account_tab'] || ! UM()->options()->get( 'changedpw_email_on' ) ) {
|
||||
// Avoid email duplicates (account changed and password changed) on the password change tab.
|
||||
um_fetch_user( $user_id );
|
||||
UM()->mail()->send( um_user( 'user_email' ), 'changedaccount_email' );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( um_user( 'user_email' ), 'changedaccount_email' ) );
|
||||
}
|
||||
// phpcs:enable WordPress.Security.NonceVerification
|
||||
}
|
||||
|
||||
@@ -120,9 +120,9 @@ function um_send_registration_notification( $user_id ) {
|
||||
if ( ! empty( $emails ) ) {
|
||||
foreach ( $emails as $email ) {
|
||||
if ( 'pending' !== $registration_status ) {
|
||||
UM()->mail()->send( $email, 'notification_new_user', array( 'admin' => true ) );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $email, 'notification_new_user', array( 'admin' => true ) ) );
|
||||
} else {
|
||||
UM()->mail()->send( $email, 'notification_review', array( 'admin' => true ) );
|
||||
UM()->maybe_action_scheduler()->enqueue_async_action( 'um_dispatch_email', array( $email, 'notification_review', array( 'admin' => true ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+9
-11
@@ -23,11 +23,9 @@
|
||||
"scripts": {
|
||||
"build:docs": "rm -rf docs/hooks/ && jsdoc -c hookdoc-conf.json",
|
||||
"build": "npm-run-all build:*",
|
||||
"build:all-blocks": "npm-run-all --parallel build-block-*",
|
||||
"build-block-um-member-directories": "cd includes/blocks/um-member-directories && wp-scripts build src/index.js",
|
||||
"build-block-um-forms": "cd includes/blocks/um-forms && wp-scripts build src/index.js",
|
||||
"build-block-um-password-reset": "cd includes/blocks/um-password-reset && wp-scripts build src/index.js",
|
||||
"build-block-um-account": "cd includes/blocks/um-account && wp-scripts build src/index.js"
|
||||
"build-blocks": "wp-scripts build --webpack-src-dir=blocks-src --output-path=includes/blocks",
|
||||
"build-manifest": "wp-scripts build-blocks-manifest --input=includes/blocks --output=includes/blocks/blocks-manifest.php",
|
||||
"build:all-blocks": "npm-run-all build-blocks build-manifest"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10.0"
|
||||
@@ -43,12 +41,12 @@
|
||||
"jsdoc": "~4.0.2",
|
||||
"wp-hookdoc": "^0.2.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"@wordpress/block-editor": "^11.5.0",
|
||||
"@wordpress/blocks": "^12.5.0",
|
||||
"@wordpress/components": "^23.5.0",
|
||||
"@wordpress/i18n": "^4.28.0",
|
||||
"@wordpress/scripts": "^25.5.1",
|
||||
"@wordpress/server-side-render": "^4.5.0"
|
||||
"@wordpress/block-editor": "^14.5.0",
|
||||
"@wordpress/blocks": "^13.10.0",
|
||||
"@wordpress/components": "^28.10.0",
|
||||
"@wordpress/i18n": "^5.10.0",
|
||||
"@wordpress/scripts": "^30.3.0",
|
||||
"@wordpress/server-side-render": "^5.10.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^18.2.0",
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
<exclude-pattern>node_modules/*</exclude-pattern>
|
||||
<exclude-pattern>documentor/*</exclude-pattern>
|
||||
<exclude-pattern>\.idea/*</exclude-pattern>
|
||||
<exclude-pattern>includes/blocks/*</exclude-pattern>
|
||||
<exclude-pattern>blocks-src/*</exclude-pattern>
|
||||
|
||||
<rule ref="WordPress-Extra"/>
|
||||
|
||||
|
||||
+21
-2
@@ -5,8 +5,8 @@ Contributors: ultimatemember, champsupertramp, nsinelnikov
|
||||
Tags: community, member, membership, user-profile, user-registration
|
||||
Requires PHP: 5.6
|
||||
Requires at least: 5.5
|
||||
Tested up to: 6.6
|
||||
Stable tag: 2.8.9
|
||||
Tested up to: 6.7
|
||||
Stable tag: 2.9.0
|
||||
License: GPLv3
|
||||
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
|
||||
@@ -166,6 +166,22 @@ No specific extensions are needed. But we highly recommended keep active these P
|
||||
|
||||
IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSION 2.6.7 PATCHES SECURITY PRIVILEGE ESCALATION VULNERABILITY. PLEASE SEE [THIS ARTICLE](https://docs.ultimatemember.com/article/1866-security-incident-update-and-recommended-actions) FOR MORE INFORMATION
|
||||
|
||||
= 2.9.0 2024-11-12 =
|
||||
|
||||
**Enhancements**
|
||||
|
||||
* Added: Action Scheduler (version 3.8.1) for email sending. More info is [here](https://actionscheduler.org/).
|
||||
* Added: Supporting new `wp_register_block_metadata_collection()` function for registering WP Blocks
|
||||
|
||||
**Bugfixes**
|
||||
|
||||
* Fixed: `ajax_image_upload()` and `ajax_resize_image()` handlers vulnerability. CVE ID: CVE-2024-10528
|
||||
* Fixed: Disabling user status column wp-admin > Users screen
|
||||
* Fixed: User status filter on wp-admin > Users on mobile devices
|
||||
* Fixed: Extra unwrapping of the WP Editor field's value
|
||||
|
||||
**Cached and optimized/minified assets(JS/CSS) must be flushed/re-generated after upgrade**
|
||||
|
||||
= 2.8.9 2024-10-14 =
|
||||
|
||||
**Enhancements**
|
||||
@@ -456,6 +472,9 @@ IMPORTANT: PLEASE UPDATE THE PLUGIN TO AT LEAST VERSION 2.6.7 IMMEDIATELY. VERSI
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 2.9.0 =
|
||||
This version fixes a security related bug. Upgrade immediately.
|
||||
|
||||
= 2.8.7 =
|
||||
This version fixes a security related bug. Upgrade immediately.
|
||||
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@
|
||||
* Plugin Name: Ultimate Member
|
||||
* Plugin URI: http://ultimatemember.com/
|
||||
* Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
|
||||
* Version: 2.8.9
|
||||
* Version: 2.9.0
|
||||
* Author: Ultimate Member
|
||||
* Author URI: http://ultimatemember.com/
|
||||
* Text Domain: ultimate-member
|
||||
@@ -17,7 +17,7 @@
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
||||
$plugin_data = get_plugin_data( __FILE__ );
|
||||
$plugin_data = get_plugin_data( __FILE__, true, false );
|
||||
|
||||
// phpcs:disable Generic.NamingConventions.UpperCaseConstantName
|
||||
define( 'um_url', plugin_dir_url( __FILE__ ) );
|
||||
|
||||
Reference in New Issue
Block a user