sudo apt-get update && sudo apt-get upgrade
sudo apt-get install -y apache2
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
import React from "react"; | |
import { useRouter } from "next/router"; | |
import * as Tabs from "@radix-ui/react-tabs"; | |
const TabsDemo = () => { | |
const router = useRouter(); | |
const initialTab = router.query.tab; | |
const [activeTab, setActiveTab] = React.useState(initialTab || "tab1"); | |
const handleTabChange = (value) => { |
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
export function TabsDemo() { | |
const [tab, setTab] = useState("tab1"); | |
const onTabChange = (value) => { | |
setTab(value); | |
} | |
return ( | |
<Tabs value={tab} onValueChange={onTabChange} className="w-[400px]"> | |
<TabsList className="grid w-full grid-cols-2"> |
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
fetch(ajax_url, { | |
method: 'POST', | |
credentials: 'same-origin', | |
headers: new Headers({'Content-Type': 'application/x-www-form-urlencoded'}), | |
body: 'action=zget_profile_user' | |
}) | |
.then((resp) => resp.json()) | |
.then(function(data) { | |
if(data.status == "success"){ | |
_this.setState({loaded:true,user:data.user}); |
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 | |
/** | |
* Plugin Name: [Forminator] Grants Full Access For Editor Role. | |
* Plugin URI: https://premium.wpmudev.org/ | |
* Description: This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages. | |
* Author: Glauber Silva @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org/ | |
* Task: 0/11289012348292/1169742392170370 | |
* License: GPLv2 or later | |
* |
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 | |
/** | |
* Plugin Name: [Forminator] Load custom posts on Select Field and get IDs on the on-change event. | |
* Plugin URI: https://wpmudev.com/ | |
* Description: With the ID retrieved on the "on change" event, you can write your custom code to get the post data and fill the correspondent fields on the form, more details about how to do it on the comment of this snippet. | |
* Author: Glauber Silva @ WPMUDEV | |
* Author URI: https://wpmudev.com/ | |
* Task: SLS-3568 | |
* License: GPLv2 or later | |
* |
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 | |
$category = get_the_category( get_the_ID() ); | |
if ( $category ) : | |
?> | |
<span class="entry-category"> | |
<a href="<?php echo esc_url( get_category_link( $category[0]->term_id ) ); ?>"><?php echo esc_attr( $category[0]->name ); ?></a> | |
</span> | |
<?php endif; // End if category ?> |
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 | |
/** | |
* Change the excerpt more string. | |
* | |
* @since 1.0.0 | |
* @param string $more | |
* @return string | |
*/ | |
function prefix_excerpt_more( $more ) { | |
return '…'; |
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 | |
/** | |
* Control excerpt length. | |
*/ | |
function prefix_excerpt_length( $length ) { | |
return 20; | |
} | |
add_filter( 'excerpt_length', 'prefix_excerpt_length', 999 ); |
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 | |
$comments = get_comments( array( | |
'number' => 5, | |
'status' => 'approve', | |
'post_status' => 'publish' | |
) ); | |
?> | |
<?php if ( $comments ) : ?> | |
<ul> | |
<?php foreach( $comments as $comment ) : ?> |
NewerOlder