Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: Added notifications for Hello Elementor theme [ED-16360] #439

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .buildignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package.json
phpcs.xml
README.md
webpack.config.js
vendor/

.github/
.buildignore
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,30 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: "Debug info: show tooling versions"
continue-on-error: true
run: |
set +e
echo "Start debug Info"
echo "Date: ${{ steps.date.outputs.date }}"
echo "PHP Version: $(php -v)"
echo "Composer Version: $(composer --version)"
echo "Node Version: $(node --version)"
echo "NPM Version: $(npm --version)"
echo "GIT Version: $(git --version)"
echo "The github context is:"
echo "${{ toJson(github) }}"
echo "The Theme version is:"
echo "${{ env.PACKAGE_VERSION }}"
echo "The Theme slug is:"
echo "${{ env.THEME_SLUG }}"
echo "End debug Info"
echo "exitcode=$?" >> $GITHUB_OUTPUT
- name: Install Dependencies
run: npm ci
- name: Install Composer dependencies
run:
composer install --no-dev
- name: Bump version on push to release or develop
if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/release/') || github.ref == 'refs/heads/develop')
run: |
Expand Down
13 changes: 13 additions & 0 deletions assets/dev/js/admin/pages/settings-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ export const SettingsPage = () => {
<div className="hello_elementor__container">
<div className="hello_elementor__title">
<h1>{ __( 'Hello Theme Settings', 'hello-elementor' ) }</h1>
<Button
size={ 'small' }
variant={ 'link' }
onClick={ () => {
const dialog = document.getElementById( 'hello-elementor-notifications-dialog' );

if ( dialog ) {
dialog.showModal();
}
} }
>
changelog
</Button>
</div>
</div>
</div>
Expand Down
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
{
"name": "elementor/hello-theme",
"require": {
"require-dev": {
"squizlabs/php_codesniffer": "^3.6",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.1",
"wp-coding-standards/wpcs": "^2.3"
},
"require": {
"elementor/wp-notifications-package": "dev-tweak/ED-16360-initial-wip"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"scripts": {
"lint": "phpcs --extensions=php -p"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/elementor/wp-notifications-package"
}
]
}
128 changes: 99 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* @package HelloElementor
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down
20 changes: 20 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package HelloElementor
*/

use Elementor\WPNotificationsPackage\V100\Notifications as ThemeNotifications;

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down Expand Up @@ -261,3 +263,21 @@ function hello_elementor_body_open() {
wp_body_open();
}
}

function hello_elementor_get_theme_notifications(): ThemeNotifications {
static $notifications = null;

if ( null === $notifications ) {
require get_template_directory() . '/vendor/autoload.php';

$notifications = new ThemeNotifications(
'hello-elementor',
HELLO_ELEMENTOR_VERSION,
'theme'
);
}

return $notifications;
}

hello_elementor_get_theme_notifications();
1 change: 0 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
* @package HelloElementor
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down
1 change: 0 additions & 1 deletion includes/admin-functions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down
1 change: 0 additions & 1 deletion includes/customizer-functions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down
1 change: 0 additions & 1 deletion includes/customizer/customizer-action-links.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace HelloElementor\Includes\Customizer;

if ( ! defined( 'ABSPATH' ) ) {
Expand Down
1 change: 0 additions & 1 deletion includes/customizer/customizer-upsell.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace HelloElementor\Includes\Customizer;

if ( ! defined( 'ABSPATH' ) ) {
Expand Down
1 change: 0 additions & 1 deletion includes/elementor-functions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
Expand Down
Loading
Loading