idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
60,300 | protected function importPbPostMeta ( $ pid , $ p ) { $ data_model = $ this -> figureOutDataModel ( $ p [ 'postmeta' ] ) ; $ meta_to_update = apply_filters ( 'pb_import_metakeys' , [ 'pb_section_license' , 'pb_short_title' , 'pb_subtitle' , 'pb_show_title' ] ) ; foreach ( $ meta_to_update as $ meta_key ) { $ meta_val =... | Import Pressbooks specific post meta |
60,301 | protected function searchForMetaValue ( $ meta_key , array $ postmeta ) { if ( empty ( $ postmeta ) ) { return '' ; } foreach ( $ postmeta as $ meta ) { if ( $ meta_key === $ meta [ 'key' ] ) { $ meta_val = $ meta [ 'value' ] ; if ( is_serialized ( $ meta_val ) ) { $ meta_val = unserialize ( $ meta_val ) ; if ( is_obje... | Check for PB specific metadata returns empty string if not found . |
60,302 | public function buildListOfKnownMedia ( $ xml ) { $ known_media = [ ] ; foreach ( $ xml [ 'posts' ] as $ item ) { if ( $ item [ 'post_type' ] !== 'attachment' ) { continue ; } $ x = [ ] ; foreach ( $ item [ 'postmeta' ] as $ meta ) { if ( $ meta [ 'key' ] === '_wp_attachment_metadata' ) { $ x = maybe_unserialize ( $ me... | Parse XML to build an array of known images |
60,303 | protected function fixInternalShortcodes ( ) { $ fix = function ( $ post_id , $ transition_type , $ shortcode ) { $ replace_pairs = [ ] ; $ post = get_post ( $ post_id ) ; foreach ( $ this -> transitions as $ transition ) { if ( $ transition -> type === $ transition_type ) { $ md5 = md5 ( $ transition -> oldId . $ tran... | Fix shortcodes with references to internal IDs |
60,304 | protected function paramSearchMeta ( array $ search ) { $ request_metadata = new \ WP_REST_Request ( 'GET' , '/pressbooks/v2/metadata' ) ; $ response_metadata = rest_do_request ( $ request_metadata ) ; $ book_metadata = $ response_metadata -> get_data ( ) ; if ( $ this -> keyValueSearchInMeta ( $ search , $ book_metada... | Parameter based search |
60,305 | function addOptions ( ) { if ( is_array ( $ this -> options ) ) extract ( $ this -> options , EXTR_SKIP ) ; global $ themecolors ; if ( empty ( $ bg ) ) $ bg = isset ( $ themecolors [ 'bg' ] ) ? $ themecolors [ 'bg' ] : 'transparent' ; if ( empty ( $ fg ) ) $ fg = isset ( $ themecolors [ 'text' ] ) ? $ themecolors [ 't... | Sets up default options |
60,306 | public function invocation ( $ sku , $ not_used_1 , $ not_used_2 , $ text_font , $ text_size ) { $ ps [ ] = "50 50 moveto ({$sku}) (includetext textfont={$text_font} textsize={$text_size} height=0.5)" ; $ ps [ ] = '/code128 /uk.co.terryburton.bwipp findresource exec' ; return implode ( "\n" , $ ps ) . "\n" ; } | SKU Invocation Code . |
60,307 | public function compile ( $ path_to_ps ) { if ( empty ( $ this -> sku ) ) { throw new \ LogicException ( '$this->sku is not set' ) ; } $ sku = \ Pressbooks \ Utility \ get_contents ( PB_PLUGIN_DIR . 'symbionts/postscriptbarcode/code128.ps' ) ; $ invocation = $ this -> invocation ( $ this -> sku , null , null , $ this -... | Compile a SKU Postscript file |
60,308 | public function lockTheme ( ) { if ( true === $ this -> copyAssets ( ) ) { $ time = time ( ) ; $ data = $ this -> generateLock ( $ time ) ; $ _SESSION [ 'pb_notices' ] [ ] = sprintf ( '<strong>%s</strong>' , sprintf ( __ ( 'Your book’s theme, %1$s, has been locked in its current state as of %2$s at %3$s.' , 'pres... | Lock the current theme by copying assets to the lock directory and generating a timestamped lockfile . |
60,309 | public function isLocked ( ) { $ options = get_option ( 'pressbooks_export_options' ) ; if ( realpath ( $ this -> getLockDir ( false ) . '/lock.json' ) && isset ( $ options [ 'theme_lock' ] ) && 1 === absint ( $ options [ 'theme_lock' ] ) ) { return true ; } return false ; } | Check for a lockfile . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.