Skip to content

Instantly share code, notes, and snippets.

View louisreingold's full-sized avatar

Louis Reingold louisreingold

  • Soflyy
  • Tahoe
View GitHub Profile
@louisreingold
louisreingold / breakdance-global-settings-api-example.php
Created November 23, 2023 06:09
Breakdance Global Settings API Example
<?php
use function \Breakdance\Elements\controlSection;
use function \Breakdance\Elements\control;
add_filter('breakdance_global_settings_control_sections_append', function ($appendedControlSections) {
$myControlSection = controlSection('my_section', 'My Section', [
control(
'my_control',
<symbol id="icon-cross" viewBox="0 0 32 32">
<title>cross</title>
<path d="M31.708 25.708c-0-0-0-0-0-0l-9.708-9.708 9.708-9.708c0-0 0-0 0-0 0.105-0.105 0.18-0.227 0.229-0.357 0.133-0.356 0.057-0.771-0.229-1.057l-4.586-4.586c-0.286-0.286-0.702-0.361-1.057-0.229-0.13 0.048-0.252 0.124-0.357 0.228 0 0-0 0-0 0l-9.708 9.708-9.708-9.708c-0-0-0-0-0-0-0.105-0.104-0.227-0.18-0.357-0.228-0.356-0.133-0.771-0.057-1.057 0.229l-4.586 4.586c-0.286 0.286-0.361 0.702-0.229 1.057 0.049 0.13 0.124 0.252 0.229 0.357 0 0 0 0 0 0l9.708 9.708-9.708 9.708c-0 0-0 0-0 0-0.104 0.105-0.18 0.227-0.229 0.357-0.133 0.355-0.057 0.771 0.229 1.057l4.586 4.586c0.286 0.286 0.702 0.361 1.057 0.229 0.13-0.049 0.252-0.124 0.357-0.229 0-0 0-0 0-0l9.708-9.708 9.708 9.708c0 0 0 0 0 0 0.105 0.105 0.227 0.18 0.357 0.229 0.356 0.133 0.771 0.057 1.057-0.229l4.586-4.586c0.286-0.286 0.362-0.702 0.229-1.057-0.049-0.13-0.124-0.252-0.229-0.357z"></path>
</symbol>
<svg class="icon icon-cross"><use xlink:href="#icon-cross"></use></svg>
.icon {
display: inli
#ct-widget-form input {
background-color: rgb(27, 31, 35) !important;
box-shadow: inset 1px 1px 0px rgba(0, 0, 0, 0.1), 1px 1px 1px rgba(255, 255, 255, 0.05), -1px -1px 1px rgba(0, 0, 0, 0.08) !important;
border: 1px solid #111 !important;
border-radius: 2px !important;
padding: 5px;
}
add_action( 'pmxi_saved_post', 'post_saved', 10, 1 );
function post_saved( $id ) {
global $wpdb;
$pass = get_user_meta( $id, 'xfer_user_pass', true );
$table = $wpdb->prefix . 'users';
$wpdb->query( $wpdb->prepare(
"
UPDATE `" . $table . "`
SET `user_pass` = %s