generated from alleyinteractive/create-wordpress-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from alleyinteractive/feature
Base functionality of the modified date control plugin
- Loading branch information
Showing
28 changed files
with
831 additions
and
565 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Entry point "plugin" script registration and enqueue. | ||
* | ||
* This file will be copied to the assets output directory | ||
* with Webpack using wp-scripts build. The build command must | ||
* be run before this file will be available. | ||
* | ||
* This file must be included from the build output directory in a project. | ||
* and will be loaded from there. | ||
* | ||
* @package wp-modified-date-control | ||
*/ | ||
|
||
/** | ||
* Register the plugin entry point assets so that they can be enqueued. | ||
*/ | ||
function wp_modified_date_control_register_plugin_scripts(): void { | ||
// Automatically load dependencies and version. | ||
$asset_file = include __DIR__ . '/index.asset.php'; | ||
|
||
// Register the plugin script. | ||
wp_register_script( | ||
'wp-modified-date-control-plugin-js', | ||
plugins_url( 'index.js', __FILE__ ), | ||
$asset_file['dependencies'], | ||
$asset_file['version'], | ||
true | ||
); | ||
wp_set_script_translations( 'wp-modified-date-control-plugin-js', 'wp-modified-date-control' ); | ||
|
||
// Register the plugin style. | ||
wp_register_style( | ||
'wp-modified-date-control-plugin-css', | ||
plugins_url( 'index.css', __FILE__ ), | ||
[], | ||
$asset_file['version'], | ||
); | ||
} | ||
add_action( 'init', 'wp_modified_date_control_register_plugin_scripts' ); | ||
|
||
/** | ||
* Enqueue styles/scripts for the plugin entry point. | ||
*/ | ||
function wp_modified_date_control_enqueue_plugin(): void { | ||
wp_enqueue_script( 'wp-modified-date-control-plugin-js' ); | ||
wp_enqueue_style( 'wp-modified-date-control-plugin-css' ); | ||
} | ||
add_action( 'enqueue_block_assets', 'wp_modified_date_control_enqueue_plugin' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Entry for plugin sidebar. | ||
*/ | ||
|
||
import { registerPlugin } from '@wordpress/plugins'; | ||
import Sidebar from './sidebar'; | ||
|
||
registerPlugin('wp-modified-date-control', { | ||
render: Sidebar, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
.postModifiedRow { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: row; | ||
gap: calc(8px); | ||
justify-content: space-between; | ||
width: 100%; | ||
|
||
button { | ||
text-align: left; | ||
white-space: unset; | ||
} | ||
} | ||
|
||
.postModifiedPopover { | ||
min-width: 320px; | ||
padding: 16px; | ||
} | ||
|
||
.postModifiedPopoverHeader { | ||
display: flex; | ||
|
||
h3 { | ||
line-height: 1.2; | ||
margin: 0px; | ||
color: rgb(30, 30, 30); | ||
font-size: calc(13px); | ||
font-weight: 600; | ||
display: block; | ||
} | ||
|
||
button { | ||
margin-left: auto; | ||
} | ||
} |
Oops, something went wrong.