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
<html> | |
<head></head> | |
<body> | |
<p name="codepenName" id="codepenID" class="codepenClass">Hello World</p> | |
<script> | |
//way1 | |
/* | |
var x = window.document.getElementById('codepenID') |
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
<div class="form-file"> | |
<input type="file" class="form-file-input" onchange="changeFile(this.files[0].name, 'form-file-personal-text')" id="customFile" name="personal" required/> | |
<label class="form-file-label" for="customFile"> | |
<span class="form-file-text" id="form-file-personal-text">Personal Image ...</span> | |
<span class="form-file-button">Select</span> | |
</label> | |
</div> | |
<script> | |
function changeFile(filename, id) |
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 | |
//in Model.php | |
public function contributes() | |
{ | |
return $this->hasmany('\App\ExamUserSelect', 'exam_id'); | |
} | |
/* in controller | |
* grouped by group_id |
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
<select name="syntax"> | |
<?php | |
$versions = array( | |
3 => __( 'Version 3.x', 'domain' ), | |
2 => __( 'Version 2.x', 'domain' ), | |
); | |
foreach ( $versions as $version => $name ) { | |
echo '<option value="' . esc_attr( $version ) . '"' . selected( $this->settings['pversion'], $version, false ) . '>' . esc_html( $name ) . "</option>"; | |
} |
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
<template> | |
<v-text-field | |
name="password" | |
:value="myPass" | |
label="Enter password" | |
:append-icon="value ? 'visibility' : 'visibility_off'" | |
@click:append="() => (value = !value)" | |
:type="value ? 'password' : 'text'" | |
></v-text-field> | |
</template> |
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
add_action( 'save_post_{custom_post_type}', 'hook_callback' ); | |
public function hook_callback($post_id) | |
{ | |
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) | |
return; | |
if( !empty($_POST) ) | |
{ | |
//your statements like save metaboxes or fire any hooks | |
} |
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
//referral post type | |
//iranam plugin | |
function sort_referral($mains, $user_id) | |
{ | |
$result = []; | |
foreach( $mains as $key=>$main ) | |
{ | |
$data = $main; | |
if( (int)$main->post_author == $user_id ) |
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
//orders is table rows | |
<template v-slot:[`item.row_num`]="{ item }"> | |
{{ (total-orders.indexOf(item)) - ((page-1)*10) }} | |
</template> |
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
<b-nav-item-dropdown v-b-hover="onOverService" ref="showServices" text="services"> | |
<b-dropdown-item to="/">one</b-dropdown-item> | |
<b-dropdown-item to="/">two</b-dropdown-item> | |
</b-nav-item-dropdown> | |
<!-- method --> | |
onOverService(isHovered) | |
{ | |
if(isHovered) | |
this.$refs.showService.visible = true |
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
DELETE FROM wp_usermeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_users | |
WHERE wp_usermeta.user_id = wp_users.ID | |
) |
OlderNewer