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
<?php | |
add_filter( 'wp_handle_upload', 'yourprefix_strip_metadata_from_images_on_upload' ); | |
function yourprefix_strip_metadata_from_images_on_upload( array $upload ): array { | |
if ( ! in_array( $upload['type'], array( 'image/jpeg', 'image/png', 'image/gif' ), true ) ) { | |
return $upload; | |
} | |
try { | |
yourprefix_strip_metadata_from_image( $upload['file'] ); |
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
<?php | |
use App\Providers\RouteServiceProvider; | |
use App\Models\User; | |
use Illuminate\Auth\Events\Lockout; | |
use Illuminate\Support\Facades\RateLimiter; | |
use Illuminate\Support\Str; | |
use Illuminate\Validation\ValidationException; | |
use Livewire\Attributes\Layout; | |
use Livewire\Attributes\Rule; |
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
<?php | |
// On top of the User model add: | |
use App\Notifications\MagicLoginLink; | |
use Grosv\LaravelPasswordlessLogin\PasswordlessLogin; | |
// In the model class, add the following methods: | |
public function sendMagicLoginLinkNotification(): void | |
{ | |
$this->notify(new MagicLoginLink($this->getMagicLoginLink())); |
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
<?php | |
namespace App\Notifications; | |
use Illuminate\Notifications\Messages\MailMessage; | |
use Illuminate\Notifications\Notification; | |
class MagicLoginLink extends Notification | |
{ | |
/** |
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
<?php | |
namespace App\Listeners; | |
use App\Events\RequestMagicLoginLink; | |
use App\Models\User; | |
class SendMagicLoginLinkNotification | |
{ | |
/** |
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
<?php | |
namespace App\Events; | |
use App\Models\User; | |
use Illuminate\Queue\SerializesModels; | |
class RequestMagicLoginLink | |
{ | |
use SerializesModels; |
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
#!/bin/bash | |
# Download the JSON file | |
curl -sSL https://plugintable.com/plugins.json -o plugins.json | |
# Extract the plugin slugs using jq | |
plugin_slugs=$(jq -r '.[].slug' plugins.json) | |
# Loop through each plugin slug and install it using wp-cli | |
for slug in $plugin_slugs; do |
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
<?php | |
add_filter( 'allowed_block_types_all', function( $allowed_blocks, $editor_context ) { | |
if ( in_array( $editor_context->post?->post_type, ['post', 'page'] ) ) { | |
$blocks = array_diff( | |
array_keys( WP_Block_Type_Registry::get_instance()->get_all_registered() ), | |
[ | |
'core/image', |
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
<!-- Define the Alpine.js component using x-data --> | |
<div x-data="{ show: false }"> | |
<!-- Bind the type attribute to the value of show using the :type notation --> | |
<input :type="show ? 'text' : 'password'" name="password" type="password" value="LookMaaGreatPassw0rd!" /> | |
<!-- Toggle the value of show on click using @click and bind the class | |
attribute to it using the :class notation --> | |
<svg @click="show = !show" :class="{'block': !show, 'hidden':show }">...</svg> |