Skip to content

Instantly share code, notes, and snippets.

View obiPlabon's full-sized avatar
🎯
1 goal

Md Obidullah obiPlabon

🎯
1 goal
View GitHub Profile
@obiPlabon
obiPlabon / style-tab.jsx
Created January 30, 2025 12:54
Gutenberg / Block code snippets
<InspectorControls group="styles">
// controls
</InspectorControls>
@obiPlabon
obiPlabon / disable_likes_comments_for_group-v2.php
Last active September 22, 2024 07:09
Disable like and comment button from BuddyBoss and BuddyPress group
<?php
function disable_likes_comments_for_group( $group_id ) {
add_filter( 'bp_activity_can_comment', static function( $enabled ) use( $group_id ) {
if ( bp_is_group() && bp_get_current_group_id() === $group_id ) {
return false;
}
return $enabled;
} );
@obiPlabon
obiPlabon / fix-drestaurant-feature-list-field.php
Created December 25, 2023 06:41
Fix dRestaurant feature list field sanitization issue
<?php
function drestaurant_sanitize_listing_form_meta_fields( $meta_data, $posted_data ) {
$feature_list = directorist_get_listing_form_field( $posted_data['directory_id'], 'drestaurant_feature_list' );
if ( empty( $feature_list ) ) {
return $meta_data;
}
if ( ! isset( $feature_list['field_key'] ) || ! isset( $posted_data[ $feature_list['field_key'] ] ) ) {
# See branchs with author name
git branch --list --format="%(committerdate:short) %(authorname) %(refname:short)" --sort=committerdate | grep obiPlabon
@obiPlabon
obiPlabon / gp-populate-anything-merge-tag-context-modifier.php
Created April 2, 2023 07:40 — forked from spivurno/gp-populate-anything-merge-tag-context-modifier.php
Gravity Perks // Populate Anything // Replace Merge Tags in Specific Context
<?php
/**
* Gravity Perks // Populate Anything // Replace Merge Tags in Specific Context
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/
*
* @video https://www.loom.com/share/d626a60769ee48579b6f426a677918a3
*
* This snippet allows you to replace a merge tag in the context of an entry selected in a GPPA-populated field. For
* example, if you populate a Drop Down field with entries and then have an HTML field which includes the {all_fields}
* merge tag, you could use the context modifier to specify that Drop Down field as the context like so:
@obiPlabon
obiPlabon / ffmpeg-watermark.md
Created December 25, 2022 16:00 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.

@obiPlabon
obiPlabon / assets-directory-structure.md
Created January 24, 2022 15:41
Assets directory structure proposal for Directorist
  • assets
    • images
    • fonts
    • extra {for additional non categoried items}
    • src
      • frontend/public
        • scss
        • js
      • backend/admin
  • scss
@obiPlabon
obiPlabon / directorist-rank-math-rating-support.php
Last active August 18, 2021 13:18
Add RankMath ratingValue schema support to Directorist
<?php
add_filter( 'rank_math/json_ld', function( $schemas, $jsonld ) {
if ( ! ( defined( 'ATBDP_POST_TYPE' ) && is_singular( ATBDP_POST_TYPE ) ) ) {
return $schemas;
}
foreach ( $schemas as $key => &$schema ) {
if ( is_array( $schema['@type'] ) ) {
continue;
<?php
// If you want to add something before the form start
add_action( 'directorist_before_add_listing_from_frontend', function() {
?>
<!-- Add your code here -->
<?php
} );
// If you want to add something after the form end
add_action( 'directorist_after_submit_listing_frontend', function() {