Skip to content

Instantly share code, notes, and snippets.

@omarkhatibco
omarkhatibco / Wordpress: Custom Post url_postid
Last active November 9, 2020 14:16 — forked from ganicus/Wordpress: Custom Post url_postid
Wordpress Function For Getting Custom Posts IDs From Their URLs
<?php
/* Post URLs to IDs function, supports custom post types - borrowed and modified from url_to_postid() in wp-includes/rewrite.php */
function bwp_url_to_postid($url)
{
global $wp_rewrite;
$url = apply_filters('url_to_postid', $url);
// First, check to see if there is a 'p=N' or 'page_id=N' to match against
if ( preg_match('#[?&](p|page_id|attachment_id)=(\d+)#', $url, $values) ) {
GIT & GitHub
https://www.youtube.com/watch?v=2QP4QxzG-wY
https://www.youtube.com/watch?v=5co5C3jmTWI
Php
https://laravel-ar.com/serie/9/%D9%85%D8%AF%D8%AE%D9%84-%D9%84%D8%AA%D8%B9%D9%84%D9%85-%D9%84%D8%BA%D8%A9-%D8%A8%D9%8A-%D8%A5%D8%AA%D8%B4-%D8%A8%D9%8A-php
Laravel
https://www.rwaq.org/courses/learn_laravel
@omarkhatibco
omarkhatibco / .browserslistrc
Last active January 15, 2020 09:36
Nextjs with Tailwindcss & postcss
# Browsers that we support
>0.25%
IE 11
not op_mini all
not ie_mob 11
not dead
@omarkhatibco
omarkhatibco / app.js
Last active November 27, 2023 22:05
Counter with react-countup only when the counter in viewport
import Counter from './counter';
const App = () => (
<div className='flex flex-wrap justify-between md:justify-center'>
<Counter target={150} title='Customer' duration={1} />
<Counter target={20000} title='Rooms' duration={2} />
<Counter target={40000} title='Places' duration={3} />
<Counter target={1200000} title='Users' duration={4} />
</div>
);